]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix a crash bug when mapping PPD duplex options to IPP attributes (rdar://46183976)
authorMichael R Sweet <michael.r.sweet@gmail.com>
Tue, 27 Nov 2018 03:28:33 +0000 (22:28 -0500)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Tue, 27 Nov 2018 03:28:33 +0000 (22:28 -0500)
CHANGES.md
cups/ppd-cache.c

index 004e801df731475e5c5a77676fd1fcbf570ff51d..ae9d0435988e3048d865cb77a2805a90fd271ebd 100644 (file)
@@ -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
index 51940c24ffaf23a09ee3fd5d489260e4a4fa5338..ab91f0fd4dae5bc23c94c0162928f527c4bb5612 100644 (file)
@@ -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");
   }