1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 12:25:09 +03:00

malloc-fail: Fix infinite loop in htmlParseStartTag

Found with libFuzzer, see #344.
This commit is contained in:
Nick Wellnhofer 2023-02-16 14:57:24 +01:00
parent 04c2955197
commit 0ec9c91064

View File

@ -4098,7 +4098,8 @@ htmlParseStartTag(htmlParserCtxtPtr ctxt) {
* the end of the tag. */
while ((CUR != 0) &&
!(IS_BLANK_CH(CUR)) && (CUR != '>') &&
((CUR != '/') || (NXT(1) != '>')))
((CUR != '/') || (NXT(1) != '>')) &&
(ctxt->instate != XML_PARSER_EOF))
NEXT;
}