From dcf822256b70b38c6d39446f2f66e2debfec33a3 Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Sun, 26 Feb 2023 16:53:52 +0100 Subject: malloc-fail: Fix null deref in xsltUnparsedEntityURIFunction Found with libFuzzer, see #84. --- libxslt/functions.c | 4 ++++ 1 file changed, 4 insertions(+) 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; -- cgit v1.2.1