Blame SOURCES/autotrace-0.31.1-CVE-2019-19004.patch

440f6d
diff -urN autotrace-0.31.1.old/input-bmp.c autotrace-0.31.1/input-bmp.c
440f6d
--- autotrace-0.31.1.old/input-bmp.c	2021-04-30 15:03:16.264446518 +0530
440f6d
+++ autotrace-0.31.1/input-bmp.c	2021-04-30 15:06:14.682051209 +0530
440f6d
@@ -220,6 +220,13 @@
440f6d
    * word length (32 bits == 4 bytes)
440f6d
    */
440f6d
 
440f6d
+  unsigned long overflowTest = Bitmap_Head.biWidth * Bitmap_Head.biBitCnt;
440f6d
+  if (overflowTest / Bitmap_Head.biWidth != Bitmap_Head.biBitCnt) {
440f6d
+    LOG("Error reading BMP file header. Width is too large\n");
440f6d
+    at_exception_fatal(&exp, "Error reading BMP file header. Width is too large");
440f6d
+    goto cleanup;
440f6d
+  }
440f6d
+
440f6d
   rowbytes= ( (Bitmap_Head.biWidth * Bitmap_Head.biBitCnt - 1) / 32) * 4 + 4;  
440f6d
 
440f6d
 #ifdef DEBUG