File GraphicsMagick-CVE-2016-10068.patch of Package GraphicsMagick.6323

From 56d6e20de489113617cbbddaf41e92600a34db22 Mon Sep 17 00:00:00 2001
From: Cristy <urban-warrior@imagemagick.org>
Date: Wed, 2 Nov 2016 17:07:05 -0400
Subject: [PATCH] Prevent fault in MSL interpreter

---
 ChangeLog    | 2 ++
 coders/msl.c | 2 ++
 2 files changed, 4 insertions(+)

Index: GraphicsMagick-1.3.21/coders/msl.c
===================================================================
--- GraphicsMagick-1.3.21.orig/coders/msl.c	2017-01-25 16:50:38.466031150 +0100
+++ GraphicsMagick-1.3.21/coders/msl.c	2017-01-25 16:53:42.340629488 +0100
@@ -2531,6 +2531,9 @@ MSLStartElement(void *context,const xmlC
                           Image
                             *next_image;
 
+                           if (value == (char *) NULL)
+                             break;
+
                           (void) strcpy(msl_info->image_info[n]->filename,
                                         value);
                           next_image=ReadImage(msl_info->image_info[n],
@@ -2648,18 +2651,19 @@ MSLStartElement(void *context,const xmlC
           }
         else if (LocaleCompare((char *) name,"resize") == 0)
           {
-            /* init the values */
-            width=msl_info->image[n]->columns;
-            height=msl_info->image[n]->rows;
-            x=0;
-            y=0;
-
             if (msl_info->image[n] == (Image *) NULL)
               {
                 ThrowException(msl_info->exception,OptionError,
                                NoImagesDefined,(char *) name);
                 break;
               }
+
+            /* init the values */
+            width=msl_info->image[n]->columns;
+            height=msl_info->image[n]->rows;
+            x=0;
+            y=0;
+
             if (attributes == (const xmlChar **) NULL)
               break;
             for (i=0; (attributes[i] != (const xmlChar *) NULL); i++)
openSUSE Build Service is sponsored by