]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix off-by-one error in ippEnumString (Issue #5695)
authorMichael R Sweet <michael.r.sweet@gmail.com>
Wed, 4 Dec 2019 18:45:24 +0000 (13:45 -0500)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Wed, 4 Dec 2019 18:45:24 +0000 (13:45 -0500)
CHANGES.md
cups/ipp-support.c

index 5ff677dbef4ee39eff73be3bc81e196916ab5048..f8ce9f7f5c600ae12f22d30a9c38c9a0b197f80c 100644 (file)
@@ -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)
index f83317d686b18553a512548e6b737b01c6e58eac..bd66e9e77448ad180d74c0221746dfa3afefc723 100644 (file)
@@ -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]);
   }