]> 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:27:56 +0000 (22:27 -0500)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Tue, 27 Nov 2018 03:32:24 +0000 (22:32 -0500)
CHANGES.md
cups/ppd-cache.c

index b794d25c4de01f2d8e5c9c1276be4ccfbcf8a474..92a40a515f290c5a14a69b55f464c7e7997b4941 100644 (file)
@@ -47,6 +47,8 @@ Changes in CUPS v2.3b6
 - Authentication in the web interface did not work on macOS (rdar://41444473)
 - Fixed an issue with HTTP Digest authentication (rdar://41709086)
 - The scheduler could crash when job history was purged (rdar://42198057)
+- Fixed a crash bug when mapping PPD duplex options to IPP attributes
+  (rdar://46183976)
 - Fixed a memory leak for some IPP (extension) syntaxes.
 - The `cupscgi`, `cupsmime`, and `cupsppdc` support libraries are no longer
   installed as shared libraries.
index d82961a6d29d45fa43a2a874050a7ba205507c71..9ec6ab07e8dbab43a4c27960fa93a9e770b93410 100644 (file)
@@ -292,11 +292,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");
   }