GNOME Bugzilla – Bug 757618
Patch : Dereferencing a possible NULL pointer in xsltproc.c
Last modified: 2015-12-13 19:36:29 UTC
Created attachment 314868 [details] [review] patch file NULL check is missing on pointer before dereferencing it. File : xsltproc.c Function : xsltprocExternalEntityLoader Line no : 183 version : 1.1.28 Variable 'defaultEntityLoader' is compared to null at line no 161 in xsltproc.c but dereference at line no 183 without NULL check. Please check attached patch. Patch : static xmlParserInputPtr xsltprocExternalEntityLoader(const char *URL, const char *ID, xmlParserCtxtPtr ctxt) { - xmlParserInputPtr ret; + xmlParserInputPtr ret = NULL; warningSAXFunc warning = NULL; int i; @@ -180,7 +180,8 @@ newURL = xmlStrcat(newURL, (const xmlChar *) "/"); newURL = xmlStrcat(newURL, (const xmlChar *) lastsegment); if (newURL != NULL) { - ret = defaultEntityLoader((const char *)newURL, ID, ctxt); + if (defaultEntityLoader != NULL) + ret = defaultEntityLoader((const char *)newURL, ID, ctxt); if (ret != NULL) { if (warning != NULL) ctxt->sax->warning = warning;
Fixed in master: https://git.gnome.org/browse/libxslt/commit/?id=66520a2cc01d235a58af5f973fd799de25dcfbe3