File GraphicsMagick-CVE-2018-16644.patch of Package GraphicsMagick.10305

Index: GraphicsMagick-1.2.5/coders/pict.c
===================================================================
--- GraphicsMagick-1.2.5.orig/coders/pict.c	2018-09-10 11:57:40.873041814 +0200
+++ GraphicsMagick-1.2.5/coders/pict.c	2018-09-10 12:06:11.671820159 +0200
@@ -1220,6 +1220,9 @@ static Image *ReadPICTImage(const ImageI
             */
             type=ReadBlobMSBShort(image);
             length=ReadBlobMSBShort(image);
+            if (length > GetBlobSize(image))
+              ThrowPICTReaderException(CorruptImageError,
+                InsufficientImageDataInFile, image);
             if (length == 0)
               break;
             (void) ReadBlobMSBLong(image);
openSUSE Build Service is sponsored by