]> granicus.if.org Git - imagemagick/commitdiff
Added check to prevent use of uninitialized value (https://bugs.chromium.org/p/oss...
authorDirk Lemstra <dirk@git.imagemagick.org>
Thu, 12 Apr 2018 23:30:25 +0000 (01:30 +0200)
committerDirk Lemstra <dirk@git.imagemagick.org>
Thu, 12 Apr 2018 23:30:25 +0000 (01:30 +0200)
coders/xpm.c

index 570cc3dbc11e22f447bb7e35ab96246f166e443a..a3f583b47aeb01f1a5554cddd7c55c3a99803993 100644 (file)
@@ -387,7 +387,9 @@ static Image *ReadXPMImage(const ImageInfo *image_info,ExceptionInfo *exception)
       Parse color.
     */
     (void) CopyMagickString(target,"gray",MagickPathExtent);
-    q=ParseXPMColor(p+width,MagickTrue);
+    q=(char *) NULL;
+    if (strlen(p) > width)
+      q=ParseXPMColor(p+width,MagickTrue);
     if (q != (char *) NULL)
       {
         while ((isspace((int) ((unsigned char) *q)) == 0) && (*q != '\0'))