Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > core-release-src > by-pkgid > 1a7ab957c5f785809bc63cc130ee70ce > files > 3

graphicsmagick-1.3.20-4.mga5.src.rpm

diff -up GraphicsMagick-1.3.20/coders/psd.c.CVE-2014-1947 GraphicsMagick-1.3.20/coders/psd.c
--- GraphicsMagick-1.3.20/coders/psd.c.CVE-2014-1947	2014-08-16 15:33:23.000000000 -0500
+++ GraphicsMagick-1.3.20/coders/psd.c	2014-08-20 07:30:08.767862041 -0500
@@ -1719,8 +1719,7 @@ static unsigned int WritePSDImage(const
     i;
 
   unsigned char
-    *pixels,
-    layer_name[4];
+    *pixels;
 
   unsigned int
     packet_size,
@@ -1944,8 +1943,9 @@ static unsigned int WritePSDImage(const
             (void) WriteBlob(image, 3, &layer_name[1]);
           */ 
         } else {
-          (void) sprintf((char *) layer_name, "L%02d", layer_count++ );
-          WritePascalString( image, (char*)layer_name, 4 );
+          char layer_name[MaxTextExtent];
+          (void) sprintf(layer_name, "L%02d", layer_count++ );
+          WritePascalString( image, layer_name, 4 );
         }
         tmp_image = tmp_image->next;
       };