summaryrefslogtreecommitdiff
path: root/patches/source/cups/cups-1.3.x.CVE-2010-0542.diff
blob: 6c234f03d179dbbefb744cba2b5e4e1cd382489c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--- ./filter/texttops.c.orig	2008-10-09 15:12:03.000000000 -0500
+++ ./filter/texttops.c	2010-11-27 12:42:33.000000000 -0600
@@ -181,8 +181,20 @@
     exit(1);
   }
 
-  Page    = calloc(sizeof(lchar_t *), SizeLines);
-  Page[0] = calloc(sizeof(lchar_t), SizeColumns * SizeLines);
+  if ((Page = calloc(sizeof(lchar_t *), SizeLines)) == NULL)
+  {
+    _cupsLangPrintf(stderr, _("ERROR: Unable to print %dx%d text page.\n"),
+                    SizeColumns, SizeLines);
+    exit(1);
+  }
+
+  if ((Page[0] = calloc(sizeof(lchar_t), SizeColumns * SizeLines)) == NULL)
+  {
+    _cupsLangPrintf(stderr, _("ERROR: Unable to print %dx%d text page.\n"),
+                    SizeColumns, SizeLines);
+    exit(1);
+  }
+
   for (i = 1; i < SizeLines; i ++)
     Page[i] = Page[0] + i * SizeColumns;