]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix potential buffer overflow in rastertohp (STR #4601)
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Thu, 26 Mar 2015 16:36:18 +0000 (16:36 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Thu, 26 Mar 2015 16:36:18 +0000 (16:36 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12574 a1ca3aef-8c08-0410-bb20-df032aa958be

CHANGES-2.0.txt
filter/rastertohp.c

index 56b28b5f574e51c41109a466441a1ee04b8bb48a..6f2fe0e388c8bd2cab903feb9477006444cc0d0c 100644 (file)
@@ -6,7 +6,7 @@ CHANGES IN CUPS V2.0.3
        - Restored missing generic printer icon file (STR #4587)
        - Fixed logging of configuration errors to show up as errors (STR #4582)
        - Fixed potential buffer overflows in raster code and filters
-         (STR #4598, STR #4599, STR #4600)
+         (STR #4598, STR #4599, STR #4600, STR #4601)
        - Added Russian translation (STR #4577)
 
 
index 42d43c8f51fccde45ffdd8d0cff912e520d666f9..c7cc18122884e84c5d41b1a4493c9a73d4d274fa 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Hewlett-Packard Page Control Language filter for CUPS.
  *
- * Copyright 2007-2014 by Apple Inc.
+ * Copyright 2007-2015 by Apple Inc.
  * Copyright 1993-2007 by Easy Software Products.
  *
  * These coded instructions, statements, and computer programs are the
@@ -354,7 +354,7 @@ StartPage(ppd_file_t         *ppd,  /* I - PPD file */
   * Allocate memory for a line of graphics...
   */
 
-  if ((Planes[0] = malloc(header->cupsBytesPerLine)) == NULL)
+  if ((Planes[0] = malloc(header->cupsBytesPerLine + NumPlanes)) == NULL)
   {
     fputs("ERROR: Unable to allocate memory\n", stderr);
     exit(1);
@@ -369,7 +369,7 @@ StartPage(ppd_file_t         *ppd,  /* I - PPD file */
     BitBuffer = NULL;
 
   if (header->cupsCompression)
-    CompBuffer = malloc(header->cupsBytesPerLine * 2);
+    CompBuffer = malloc(header->cupsBytesPerLine * 2 + 2);
   else
     CompBuffer = NULL;
 }