summaryrefslogtreecommitdiff
path: root/filter/rastertohp.c
diff options
context:
space:
mode:
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>2015-03-26 16:36:18 +0000
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>2015-03-26 16:36:18 +0000
commit50752acba9df1a5f5ee750c4ea8cd1fd7ee664c2 (patch)
tree32dd13c31c58c5e73fa2975f5cf05ff8fa3b7dd0 /filter/rastertohp.c
parent8326c129217aa30a7ca20219dd9e107b1a0c5623 (diff)
downloadcups-50752acba9df1a5f5ee750c4ea8cd1fd7ee664c2.tar.gz
Fix potential buffer overflow in rastertohp (STR #4601)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12574 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'filter/rastertohp.c')
-rw-r--r--filter/rastertohp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/filter/rastertohp.c b/filter/rastertohp.c
index 42d43c8f5..c7cc18122 100644
--- a/filter/rastertohp.c
+++ b/filter/rastertohp.c
@@ -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;
}