From 27e2c44b892c9804ad82c825a403486711045f9d Mon Sep 17 00:00:00 2001 From: Cristy Date: Mon, 26 Feb 2018 20:03:23 -0500 Subject: [PATCH] https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6562 --- MagickCore/property.c | 28 ++++++++++++++++++++++++++++ configure | 4 ++-- configure.ac | 2 +- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/MagickCore/property.c b/MagickCore/property.c index 2841c0622..c52f1210d 100644 --- a/MagickCore/property.c +++ b/MagickCore/property.c @@ -96,6 +96,15 @@ #include "lcms.h" #endif #endif +#if defined(MAGICKCORE_XML_DELEGATE) +# if defined(MAGICKCORE_WINDOWS_SUPPORT) +# if !defined(__MINGW32__) +# include +# endif +# endif +# include +# include +#endif /* Define declarations. @@ -1751,6 +1760,25 @@ static MagickBooleanType GetXMPProperty(const Image *image,const char *property) xmp_profile=StringInfoToString(profile); if (xmp_profile == (char *) NULL) return(MagickFalse); +#if defined(MAGICKCORE_XML_DELEGATE) + { + xmlDocPtr + xmp; + + /* + Parse XML profile. + */ + xmp=xmlReadMemory(xmp_profile,GetStringInfoLength(profile),"xmp.xml",NULL, + XML_PARSE_NOERROR | XML_PARSE_NOWARNING); + if (xmp == (xmlDocPtr) NULL) + { + xmlCleanupParser(); + xmp_profile=DestroyString(xmp_profile); + return(MagickFalse); + } + xmlFreeDoc(xmp); + } +#endif if ((strstr(xmp_profile,"