From: Michael R Sweet Date: Wed, 4 Dec 2019 18:45:24 +0000 (-0500) Subject: Fix off-by-one error in ippEnumString (Issue #5695) X-Git-Tag: v2.2.13~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=25a9f958139630698d2d22422f8113d2d10a201b;p=thirdparty%2Fcups.git Fix off-by-one error in ippEnumString (Issue #5695) --- diff --git a/CHANGES.md b/CHANGES.md index 5ff677dbef..f8ce9f7f5c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,4 @@ -CHANGES - 2.2.13 - 2019-12-02 +CHANGES - 2.2.13 - 2019-12-04 ============================= @@ -12,6 +12,7 @@ Changes in CUPS v2.2.13 permissions are wrong (Issue #5658) - Default printers set with `lpoptions` did not work in all cases (Issue #5681, Issue #5683, Issue #5684) +- Fixed an off-by-one error in `ippEnumString` (Issue #5695) - Fixed a few issues with the Apple Raster support (rdar://55301114) - The IPP backend did not detect all cases where a job should be retried using a raster format (rdar://56021091) diff --git a/cups/ipp-support.c b/cups/ipp-support.c index f83317d686..bd66e9e774 100644 --- a/cups/ipp-support.c +++ b/cups/ipp-support.c @@ -1,7 +1,7 @@ /* * Internet Printing Protocol support functions for CUPS. * - * Copyright © 2007-2018 by Apple Inc. + * Copyright © 2007-2019 by Apple Inc. * Copyright © 1997-2007 by Easy Software Products, all rights reserved. * * These coded instructions, statements, and computer programs are the @@ -1899,7 +1899,7 @@ ippEnumString(const char *attrname, /* I - Attribute name */ sizeof(ipp_finishings[0])))) return (ipp_finishings[enumvalue - 3]); else if (enumvalue >= 0x40000000 && - enumvalue <= (0x40000000 + (int)(sizeof(ipp_finishings_vendor) / + enumvalue < (0x40000000 + (int)(sizeof(ipp_finishings_vendor) / sizeof(ipp_finishings_vendor[0])))) return (ipp_finishings_vendor[enumvalue - 0x40000000]); }