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

malloc-fail: Fix null deref in xmlParserInputShrink

Found by OSS-Fuzz.
This commit is contained in:
Nick Wellnhofer 2023-03-13 16:51:14 +01:00
parent 5f4ec41bae
commit 457fc622d5

View File

@ -424,6 +424,13 @@ xmlParserInputShrink(xmlParserInputPtr in) {
}
in->base = xmlBufContent(in->buf->buffer);
if (in->base == NULL) {
/* TODO: raise error */
in->base = BAD_CAST "";
in->cur = in->base;
in->end = in->base;
return;
}
in->cur = in->base + used;
in->end = xmlBufEnd(in->buf->buffer);