From: Michael R Sweet Date: Tue, 27 Nov 2018 03:27:56 +0000 (-0500) Subject: Fix a crash bug when mapping PPD duplex options to IPP attributes (rdar://46183976) X-Git-Tag: v2.3b6~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d9eecc44e92055e1168123e953cbd49145c9cc9;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 b794d25c4d..92a40a515f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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. diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c index d82961a6d2..9ec6ab07e8 100644 --- a/cups/ppd-cache.c +++ b/cups/ppd-cache.c @@ -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"); }