After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 757663 - Patch : Dereferencing a possible NULL pointer in functions.c
Patch : Dereferencing a possible NULL pointer in functions.c
Status: RESOLVED FIXED
Product: libxslt
Classification: Platform
Component: general
1.1.x
Other Linux
: Normal major
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2015-11-06 05:06 UTC by mahendra.n
Modified: 2015-12-13 19:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch file (535 bytes, patch)
2015-11-06 05:06 UTC, mahendra.n
none Details | Review

Description mahendra.n 2015-11-06 05:06:49 UTC
Created attachment 314954 [details] [review]
Patch file

NULL check is missing on pointer before dereferencing it.
File : functions.c
Function : exsltFuncFunctionFunction
Line no : 308
version : 1.1.28

Return value of a function 'xmlHashLookup2' is dereferenced at functions.c:308 without null checking

Patch : 
Please check attached patch.

--- functions_org.c     2015-11-06 10:21:40.707992184 +0530
+++ functions.c 2015-11-06 10:22:32.027993502 +0530
@@ -301,6 +301,12 @@
     func = (exsltFuncFunctionData*) xmlHashLookup2 (data->funcs,
                                                    ctxt->context->functionURI,
                                                    ctxt->context->function);
+    if (func ==  NULL) {
+        xsltGenericError(xsltGenericErrorContext,
+                         "{%s}%s: not found\n",
+                         ctxt->context->functionURI, ctxt->context->function);
+        return;
+    }

     /*
      * params handling