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