mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-30 22:43:14 +03:00
html: Fix corner case when push-parsing HTML5 comments
This commit is contained in:
@ -4899,8 +4899,14 @@ htmlParseLookupCommentEnd(htmlParserCtxtPtr ctxt)
|
|||||||
mark = htmlParseLookupString(ctxt, 2, "--", 2, 0);
|
mark = htmlParseLookupString(ctxt, 2, "--", 2, 0);
|
||||||
if (mark < 0)
|
if (mark < 0)
|
||||||
break;
|
break;
|
||||||
|
/*
|
||||||
|
* <!--> is a complete comment, but
|
||||||
|
* <!--!> is not
|
||||||
|
* <!---!> is not
|
||||||
|
* <!----!> is
|
||||||
|
*/
|
||||||
if ((NXT(mark+2) == '>') ||
|
if ((NXT(mark+2) == '>') ||
|
||||||
((NXT(mark+2) == '!') && (NXT(mark+3) == '>'))) {
|
((mark >= 4) && (NXT(mark+2) == '!') && (NXT(mark+3) == '>'))) {
|
||||||
ctxt->checkIndex = 0;
|
ctxt->checkIndex = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user