[magick-developers] Crash on invalid XML profile

Alexander E. Patrakov patrakov at gmail.com
Sat Jan 3 09:50:48 PST 2009


2009/1/3  <duc.sequere.aut.de.via.decede at imagemagick.org>:
>> Hello, this image causes the "identify" command to crash by attempting
>
> Thanks for the problem report and patch.  We updated the ImageMagick
> Subversion trunk and the fix will be available in the next point release.


Sorry, but I am no longer sure that my fix is correct. Namely, what is
the profile supposed to be set to on such invalid images? Currently,
it is set to a string that begins with "http://". Should it be set at
all? I.e., is this more correct than my original patch?

--- coders/jpeg.c
+++ coders/jpeg.c
@@ -574,8 +574,13 @@
               break;
             p++;
           }
-          if (*p == '\0')
+          if (i < (long) GetStringInfoLength(profile))
             DestroyStringInfo(SplitStringInfo(profile,i+1));
+          else
+          {
+            profile = DestroyStringInfo(profile);
+            return(MagickTrue);
+          }
           (void) CopyMagickString(name,"xmp",MaxTextExtent);
         }
     }



-- 
Alexander E. Patrakov


More information about the Magick-developers mailing list