summaryrefslogtreecommitdiff
path: root/xmlIO.c
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2023-01-22 14:52:06 +0100
committerNick Wellnhofer <wellnhofer@aevum.de>2023-01-24 11:32:15 +0100
commit2355eac59e91e1465696150cf0efc9029ba4f9b2 (patch)
tree186ede1a8c4ccdcdcb2ec0193113f35de59f4593 /xmlIO.c
parent0c5f40b788410753eb73e3040be4f50b608923e1 (diff)
downloadlibxml2-2355eac59e91e1465696150cf0efc9029ba4f9b2.tar.gz
malloc-fail: Fix null deref if growing input buffer fails
Also add some error checks. Found with libFuzzer, see #344.
Diffstat (limited to 'xmlIO.c')
-rw-r--r--xmlIO.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/xmlIO.c b/xmlIO.c
index 05800185..d26ddc41 100644
--- a/xmlIO.c
+++ b/xmlIO.c
@@ -3218,7 +3218,8 @@ xmlParserInputBufferGrow(xmlParserInputBufferPtr in, int len) {
if (res < 0)
return(-1);
- xmlBufAddLen(buf, res);
+ if (xmlBufAddLen(buf, res) < 0)
+ return(-1);
}
/*