From c68b3f3d64d52cc97e204d1fc039372bbb62dc6e Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Sun, 13 Dec 2015 19:22:48 +0100 Subject: [PATCH] Fix possible NULL pointer deref in libexslt/functions.c Based on the patch by mahendra.n. Fixes bug #757663. https://bugzilla.gnome.org/show_bug.cgi?id=757663 --- libexslt/functions.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libexslt/functions.c b/libexslt/functions.c index b111fd8c..0795a13d 100644 --- a/libexslt/functions.c +++ b/libexslt/functions.c @@ -303,6 +303,14 @@ exsltFuncFunctionFunction (xmlXPathParserContextPtr ctxt, int nargs) { func = (exsltFuncFunctionData*) xmlHashLookup2 (data->funcs, ctxt->context->functionURI, ctxt->context->function); + if (func == NULL) { + /* Should never happen */ + xsltGenericError(xsltGenericErrorContext, + "{%s}%s: not found\n", + ctxt->context->functionURI, ctxt->context->function); + ctxt->error = XPATH_UNKNOWN_FUNC_ERROR; + return; + } /* * params handling