]> granicus.if.org Git - imagemagick/commitdiff
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5784
authorCristy <urban-warrior@imagemagick.org>
Sun, 28 Jan 2018 20:40:17 +0000 (15:40 -0500)
committerCristy <urban-warrior@imagemagick.org>
Sun, 28 Jan 2018 20:40:17 +0000 (15:40 -0500)
MagickCore/xml-tree.c
coders/wpg.c

index 7718c29101978b203b3ce6f6ed46edfb04fdb670..a25a67c4999b19fb9a28369237f4f2f403abe227 100644 (file)
@@ -1789,8 +1789,8 @@ static MagickBooleanType ParseInternalDoctype(XMLTreeRoot *root,char *xml,
                    (n != (char *) NULL) &&
                    (strcmp(n,root->attributes[i][0]) != 0))
               i++;
-            while ((*(n=xml+strspn(xml+1,XMLWhitespace)+1) != '\0') &&
-                   (*n != '>'))
+            xml++;
+            while ((*(n=xml+strspn(xml,XMLWhitespace)) != '\0') && (*n != '>'))
             {
               xml=n+strcspn(n,XMLWhitespace);
               if (*xml != '\0')
index e57a5d5f952e1234ffee3d5cc3ee21b7c5eb54be..1c2788382b5d27979ab9ee94ddf885b62849c144 100644 (file)
@@ -791,6 +791,8 @@ static Image *ExtractPostscript(Image *image,const ImageInfo *image_info,
   if(magic_info->name == (char *) NULL) goto FINISH_UNL;
 
   (void) strncpy(clone_info->magick,magic_info->name,MagickPathExtent-1);
+  if (LocaleCompare(image_info->magick,clone_info->magick) == 0)
+    (void) strcpy(clone_info->magick,"PS");
 
     /* Read nested image */
   /*FormatString(clone_info->filename,"%s:%s",magic_info->name,postscript_file);*/