1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-27 18:50:07 +03:00

malloc-fail: Fix error code in htmlParseChunk

Found with libFuzzer, see #344.
This commit is contained in:
Nick Wellnhofer 2023-02-16 15:09:32 +01:00
parent 15b0ed0815
commit 53d1cc98cf

View File

@ -6280,9 +6280,8 @@ htmlParseChunk(htmlParserCtxtPtr ctxt, const char *chunk, int size,
res = xmlParserInputBufferPush(ctxt->input->buf, size, chunk);
xmlBufSetInputBaseCur(ctxt->input->buf->buffer, ctxt->input, base, cur);
if (res < 0) {
ctxt->errNo = XML_PARSER_EOF;
ctxt->disableSAX = 1;
return (XML_PARSER_EOF);
htmlErrMemory(ctxt, NULL);
return (ctxt->errNo);
}
#ifdef DEBUG_PUSH
xmlGenericError(xmlGenericErrorContext, "HPP: pushed %d\n", size);