From: Cristy Date: Sat, 24 Feb 2018 14:02:35 +0000 (-0500) Subject: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6533 X-Git-Tag: 7.0.7-24~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d4ce595b1c95834b522fc8c3823305602f33ad79;p=imagemagick https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6533 --- diff --git a/MagickCore/xml-tree.c b/MagickCore/xml-tree.c index 0cfb02539..008ff5f3a 100644 --- a/MagickCore/xml-tree.c +++ b/MagickCore/xml-tree.c @@ -1726,6 +1726,8 @@ static MagickBooleanType ParseInternalDoctype(XMLTreeRoot *root,char *xml, xml+=strspn(xml+8,XMLWhitespace)+8; c=xml; n=xml+strspn(xml,XMLWhitespace "%"); + if ((isalpha((int) ((unsigned char) *n)) == 0) && (*n != '_')) + break; xml=n+strcspn(n,XMLWhitespace); *xml=';'; v=xml+strspn(xml+1,XMLWhitespace)+1;