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

parser: Fix regressions from previous commits

- Fix memory leak in xmlParseNmtoken.
- Fix buffer overread after htmlParseCharDataInternal.
This commit is contained in:
Nick Wellnhofer
2023-03-18 14:44:28 +01:00
parent 9ef2a9abf3
commit 067986fa67
2 changed files with 4 additions and 2 deletions

View File

@@ -3203,6 +3203,7 @@ htmlParseCharDataInternal(htmlParserCtxtPtr ctxt, int readahead) {
} else {
COPY_BUF(l,buf,nbchar,cur);
}
NEXTL(l);
if (nbchar >= HTML_PARSER_BIG_BUFFER_SIZE) {
buf[nbchar] = 0;
@@ -3228,7 +3229,6 @@ htmlParseCharDataInternal(htmlParserCtxtPtr ctxt, int readahead) {
nbchar = 0;
SHRINK;
}
NEXTL(l);
cur = CUR_CHAR(l);
}
if (ctxt->instate == XML_PARSER_EOF)