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

html: Don't check for valid XML characters

This commit is contained in:
Nick Wellnhofer 2024-09-09 02:01:19 +02:00
parent a6955c13c7
commit 9678163f54
7 changed files with 6 additions and 22 deletions

View File

@ -462,10 +462,6 @@ htmlCurrentChar(xmlParserCtxtPtr ctxt, int *len) {
if (val < 0x80)
goto encoding_error;
}
if (!IS_CHAR(val)) {
htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
"Char 0x%X out of allowed range\n", val);
}
return(val);
}
@ -3414,12 +3410,8 @@ htmlParseComment(htmlParserCtxtPtr ctxt, int bogus) {
}
buf = tmp;
}
if (IS_CHAR(cur)) {
COPY_BUF(buf,len,cur);
} else {
htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
"Invalid char in comment 0x%X\n", cur);
}
COPY_BUF(buf,len,cur);
if (len > maxLength) {
htmlParseErr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
"comment too long", NULL, NULL);

View File

@ -1,3 +1,3 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<!--<!doctype
<!-- <!doctype
-->

View File

@ -1,3 +0,0 @@
./test/HTML/758606.html:1: HTML parser error : Invalid char in comment 0xC
<!-- <!doctype
^

View File

@ -1,6 +1,5 @@
SAX.setDocumentLocator()
SAX.startDocument()
SAX.error: Invalid char in comment 0xC
SAX.comment(<!doctype
SAX.comment( <!doctype
)
SAX.endDocument()

View File

@ -1,3 +1,3 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<!--&#145;<!dOctYPE
<!-- &#145;<!dOctYPE
-->

View File

@ -1,3 +0,0 @@
./test/HTML/758606_2.html:1: HTML parser error : Invalid char in comment 0xC
<!--
^

View File

@ -1,6 +1,5 @@
SAX.setDocumentLocator()
SAX.startDocument()
SAX.error: Invalid char in comment 0xC
SAX.comment(‘<!dOctYPE
SAX.comment( ‘<!dOctYPE
)
SAX.endDocument()