mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-24 13:33:01 +03:00
malloc-fail: Fix infinite loop in htmlParseDocTypeDecl
Found with libFuzzer, see #344.
This commit is contained in:
@@ -3706,7 +3706,8 @@ htmlParseDocTypeDecl(htmlParserCtxtPtr ctxt) {
|
|||||||
htmlParseErr(ctxt, XML_ERR_DOCTYPE_NOT_FINISHED,
|
htmlParseErr(ctxt, XML_ERR_DOCTYPE_NOT_FINISHED,
|
||||||
"DOCTYPE improperly terminated\n", NULL, NULL);
|
"DOCTYPE improperly terminated\n", NULL, NULL);
|
||||||
/* Ignore bogus content */
|
/* Ignore bogus content */
|
||||||
while ((CUR != 0) && (CUR != '>'))
|
while ((CUR != 0) && (CUR != '>') &&
|
||||||
|
(ctxt->instate != XML_PARSER_EOF))
|
||||||
NEXT;
|
NEXT;
|
||||||
}
|
}
|
||||||
if (CUR == '>')
|
if (CUR == '>')
|
||||||
|
|||||||
Reference in New Issue
Block a user