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 760250 - Patch : null-pointer dereference possible in exsltFuncRegisterImportFunc
Patch : null-pointer dereference possible in exsltFuncRegisterImportFunc
Status: RESOLVED DUPLICATE of bug 735957
Product: libxslt
Classification: Platform
Component: general
1.1.x
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2016-01-07 04:58 UTC by mahendra.n
Modified: 2016-02-25 16:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch file (597 bytes, patch)
2016-01-07 04:58 UTC, mahendra.n
none Details | Review

Description mahendra.n 2016-01-07 04:58:04 UTC
Created attachment 318402 [details] [review]
Patch file

Version : 1.1.28
File    : libexslt/functions.c
Line No : 115


NULL check is missing on pointer before dereferencing it.

In file libexslt/functions.c, pointer 'func' is dereferenced at line no 115, without NULL check.



Current implementation :

    if (func == NULL) {		/* Not yet present - copy it in */
	func = exsltFuncNewFunctionData();
	memcpy(func, data, sizeof(exsltFuncFunctionData));


Proposed implementation :  
    if ((func == NULL) && (func = exsltFuncNewFunctionData())) {		/* Not yet present - copy it in */
	memcpy(func, data, sizeof(exsltFuncFunctionData));
	if (xmlHashAddEntry2(ch->hash, URI, name, func) < 0) {

Please find attached patch file (functions1.patch).
Comment 1 Nick Wellnhofer 2016-02-25 16:42:39 UTC

*** This bug has been marked as a duplicate of bug 735957 ***