From 6b9ee66fb847f9349044b4a97de28c685dff048e Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Mon, 26 Nov 2018 22:28:33 -0500 Subject: [PATCH] Fix a crash bug when mapping PPD duplex options to IPP attributes (rdar://46183976) --- CHANGES.md | 4 +++- cups/ppd-cache.c | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) 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"); } -- 2.47.2