Blame SOURCES/netpbm-CVE-2017-2587.patch

d968e0
diff -urNp old/converter/other/svgtopam.c new/converter/other/svgtopam.c
d968e0
--- old/converter/other/svgtopam.c	2017-02-08 12:11:02.593690917 +0100
d968e0
+++ new/converter/other/svgtopam.c	2017-02-08 13:49:38.319029371 +0100
d968e0
@@ -771,12 +771,17 @@ createCanvas(unsigned int const width,
d968e0
 
d968e0
     MALLOCVAR_NOFAIL(canvasP);
d968e0
 
d968e0
-    canvasP->width  = width;
d968e0
-    canvasP->height = height;
d968e0
-    canvasP->pixels = ppm_allocarray(width, height);
d968e0
-    canvasP->maxval = maxval;
d968e0
+    if(canvasP != NULL){
d968e0
+        canvasP->width  = width;
d968e0
+        canvasP->height = height;
d968e0
+        canvasP->pixels = ppm_allocarray(width, height);
d968e0
+        canvasP->maxval = maxval;
d968e0
+
d968e0
+        *canvasPP = canvasP;
d968e0
+    } else {
d968e0
+       pm_error("can't allocate memory for canvas");
d968e0
+    }
d968e0
 
d968e0
-    *canvasPP = canvasP;
d968e0
 }
d968e0
 
d968e0