[libxslt] Fix possible NULL pointer deref in libexslt/functions.c



commit c68b3f3d64d52cc97e204d1fc039372bbb62dc6e
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Sun Dec 13 19:22:48 2015 +0100

    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 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/libexslt/functions.c b/libexslt/functions.c
index b111fd8..0795a13 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]