]> granicus.if.org Git - imagemagick/commitdiff
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6081
authorCristy <urban-warrior@imagemagick.org>
Thu, 8 Feb 2018 00:48:47 +0000 (19:48 -0500)
committerCristy <urban-warrior@imagemagick.org>
Thu, 8 Feb 2018 00:48:47 +0000 (19:48 -0500)
MagickCore/xml-tree.c

index 0e9b843f32d38d839f40780d370fae941f8e8e7c..dfcfe8ccf7c436742e901fa1cfe5e9e482c04f9a 100644 (file)
@@ -1716,7 +1716,7 @@ static MagickBooleanType ParseInternalDoctype(XMLTreeRoot *root,char *xml,
       xml++;
     if (*xml == '\0')
       break;
-    if (strncmp(xml,"<!ENTITY",8) == 0)
+    if ((strlen(xml) > 9) && (strncmp(xml,"<!ENTITY",8) == 0))
       {
         /*
           Parse entity definitions.