mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-11 21:41:53 +03:00
malloc-fail: Fix infinite loop in htmlParseStartTag
Found with libFuzzer, see #344.
This commit is contained in:
@ -4098,7 +4098,8 @@ htmlParseStartTag(htmlParserCtxtPtr ctxt) {
|
|||||||
* the end of the tag. */
|
* the end of the tag. */
|
||||||
while ((CUR != 0) &&
|
while ((CUR != 0) &&
|
||||||
!(IS_BLANK_CH(CUR)) && (CUR != '>') &&
|
!(IS_BLANK_CH(CUR)) && (CUR != '>') &&
|
||||||
((CUR != '/') || (NXT(1) != '>')))
|
((CUR != '/') || (NXT(1) != '>')) &&
|
||||||
|
(ctxt->instate != XML_PARSER_EOF))
|
||||||
NEXT;
|
NEXT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user