[libxslt] Fix possible NULL pointer deref in xsltproc.c



commit 66520a2cc01d235a58af5f973fd799de25dcfbe3
Author: mahendra.n <mahendra n samsung com>
Date:   Sun Dec 13 18:55:11 2015 +0100

    Fix possible NULL pointer deref in xsltproc.c
    
    Fixes bug #757618.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=757618

 xsltproc/xsltproc.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/xsltproc/xsltproc.c b/xsltproc/xsltproc.c
index de4605e..9bd725d 100644
--- a/xsltproc/xsltproc.c
+++ b/xsltproc/xsltproc.c
@@ -140,7 +140,7 @@ xmlExternalEntityLoader defaultEntityLoader = NULL;
 static xmlParserInputPtr
 xsltprocExternalEntityLoader(const char *URL, const char *ID,
                             xmlParserCtxtPtr ctxt) {
-    xmlParserInputPtr ret;
+    xmlParserInputPtr ret = NULL;
     warningSAXFunc warning = NULL;
 
     int i;
@@ -182,7 +182,8 @@ xsltprocExternalEntityLoader(const char *URL, const char *ID,
        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;


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