Re: Invalid memory access with XML profiles
[email protected] Sat, 3 Jan 2009 11:10:40 -0800
| Newsgroups | gmane.comp.video.image-magick.devel |
|---|---|
| Message-ID | <[email protected]> |
> i.e., here p may be not 0-terminated. However, NewXmlTree() calls
> strlen() on its argument. This is a bug.
Which version of ImageMagick are you using? The latest release accounts for
the problem you reported by using StringInfoToString():
profile=GetImageProfile(image,"xmp");
if (profile == (StringInfo *) NULL)
return(MagickFalse);
if ((property == (const char *) NULL) || (*property == '\0'))
return(MagickFalse);
xmp_profile=StringInfoToString(profile);
if (xmp_profile == (char *) NULL)
return(MagickFalse);
for (p=xmp_profile; *p != '\0'; p++)
if ((*p == '<') && (*(p+1) == 'x'))
break;
exception=AcquireExceptionInfo();
xmp=NewXMLTree((char *) p,exception);