mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-24 13:33:01 +03:00
html: Fix quadratic behavior in htmlParseTryOrFinish
Fix check for end of script content. Found by OSS-Fuzz.
This commit is contained in:
@@ -6000,8 +6000,14 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
|
||||
if (idx < 0)
|
||||
goto done;
|
||||
val = in->cur[idx + 2];
|
||||
if (val == 0) /* bad cut of input */
|
||||
if (val == 0) { /* bad cut of input */
|
||||
/*
|
||||
* FIXME: htmlParseScript checks for additional
|
||||
* characters after '</'.
|
||||
*/
|
||||
ctxt->checkIndex = idx;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
htmlParseScript(ctxt);
|
||||
if ((cur == '<') && (next == '/')) {
|
||||
|
||||
Reference in New Issue
Block a user