mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
Fix infinite loop in HTML parser introduced with recent commits
Check for XML_PARSER_EOF to avoid an infinite loop introduced with recent changes to the HTML push parser. Found by OSS-Fuzz.
This commit is contained in:
@ -5872,7 +5872,8 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
|
|||||||
xmlGenericError(xmlGenericErrorContext,
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
"HPP: Parsing char data\n");
|
"HPP: Parsing char data\n");
|
||||||
#endif
|
#endif
|
||||||
while ((cur != '<') && (in->cur < in->end)) {
|
while ((ctxt->instate != XML_PARSER_EOF) &&
|
||||||
|
(cur != '<') && (in->cur < in->end)) {
|
||||||
if (cur == '&') {
|
if (cur == '&') {
|
||||||
htmlParseReference(ctxt);
|
htmlParseReference(ctxt);
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user