1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-24 13:33:01 +03:00

html: Abort earlier on fatal errors

This commit is contained in:
Nick Wellnhofer
2023-12-28 19:06:32 +01:00
parent 5f319304c8
commit 477a7ed82c

View File

@@ -3134,7 +3134,8 @@ htmlParseCharDataInternal(htmlParserCtxtPtr ctxt, int readahead) {
cur = CUR_CHAR(l);
while (((cur != '<') || (ctxt->token == '<')) &&
((cur != '&') || (ctxt->token == '&')) &&
(cur != 0)) {
(cur != 0) &&
(!PARSER_STOPPED(ctxt))) {
if (!(IS_CHAR(cur))) {
htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
"Invalid char in CDATA 0x%X\n", cur);
@@ -4186,7 +4187,7 @@ htmlParseContent(htmlParserCtxtPtr ctxt) {
currentNode = xmlStrdup(ctxt->name);
depth = ctxt->nameNr;
while (1) {
while (!PARSER_STOPPED(ctxt)) {
GROW;
/*