From: Michael R Sweet Date: Tue, 27 Nov 2018 03:28:33 +0000 (-0500) Subject: Fix a crash bug when mapping PPD duplex options to IPP attributes (rdar://46183976) X-Git-Tag: v2.2.10~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b9ee66fb847f9349044b4a97de28c685dff048e;p=thirdparty%2Fcups.git Fix a crash bug when mapping PPD duplex options to IPP attributes (rdar://46183976) --- diff --git a/CHANGES.md b/CHANGES.md index 004e801df7..ae9d043598 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,4 @@ -CHANGES - 2.2.10 - 2018-11-16 +CHANGES - 2.2.10 - 2018-11-26 ============================= @@ -9,6 +9,8 @@ Changes in CUPS v2.2.10 cupsManualCopies keyword (Issue #5433) - Kerberos credentials might be truncated (Issue #5435) - Incorporated the page accounting changes from CUPS 2.3 (Issue #5439) +- Fixed a crash bug when mapping PPD duplex options to IPP attributes + (rdar://46183976) Changes in CUPS v2.2.9 diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c index 51940c24ff..ab91f0fd4d 100644 --- a/cups/ppd-cache.c +++ b/cups/ppd-cache.c @@ -290,11 +290,11 @@ _cupsConvertOptions( ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides", NULL, keyword); else if (pc->sides_option && (choice = ppdFindMarkedChoice(ppd, pc->sides_option)) != NULL) { - if (!_cups_strcasecmp(choice->choice, pc->sides_1sided)) + if (pc->sides_1sided && !_cups_strcasecmp(choice->choice, pc->sides_1sided)) ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides", NULL, "one-sided"); - else if (!_cups_strcasecmp(choice->choice, pc->sides_2sided_long)) + else if (pc->sides_2sided_long && !_cups_strcasecmp(choice->choice, pc->sides_2sided_long)) ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides", NULL, "two-sided-long-edge"); - if (!_cups_strcasecmp(choice->choice, pc->sides_2sided_short)) + else if (pc->sides_2sided_short && !_cups_strcasecmp(choice->choice, pc->sides_2sided_short)) ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides", NULL, "two-sided-short-edge"); }