summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2023-02-26 16:53:52 +0100
committerNick Wellnhofer <wellnhofer@aevum.de>2023-02-26 16:55:37 +0100
commitdcf822256b70b38c6d39446f2f66e2debfec33a3 (patch)
treebe7cfc30c9c38eff649fdda0b620e38fcc748aeb
parent290e3e459b4f76f5fa1e3784b866cc0b76b35a55 (diff)
downloadlibxslt-dcf822256b70b38c6d39446f2f66e2debfec33a3.tar.gz
malloc-fail: Fix null deref in xsltUnparsedEntityURIFunction
Found with libFuzzer, see #84.
-rw-r--r--libxslt/functions.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libxslt/functions.c b/libxslt/functions.c
index e13cc98b..9706a7af 100644
--- a/libxslt/functions.c
+++ b/libxslt/functions.c
@@ -558,6 +558,10 @@ xsltUnparsedEntityURIFunction(xmlXPathParserContextPtr ctxt, int nargs){
obj = valuePop(ctxt);
if (obj->type != XPATH_STRING) {
obj = xmlXPathConvertString(obj);
+ if (obj == NULL) {
+ xmlXPathErr(ctxt, XPATH_MEMORY_ERROR);
+ return;
+ }
}
str = obj->stringval;