[libxslt] Check return value of exsltFuncNewFunctionData



commit fd675976f71264e1fbd84e048b9bb77386d95121
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Sun Sep 28 13:20:42 2014 +0200

    Check return value of exsltFuncNewFunctionData
    
    Fixes bug #735957.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=735957
    
    Thanks to Prabhat Kanth for the report.

 libexslt/functions.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/libexslt/functions.c b/libexslt/functions.c
index e6e245f..b111fd8 100644
--- a/libexslt/functions.c
+++ b/libexslt/functions.c
@@ -112,6 +112,8 @@ exsltFuncRegisterImportFunc (exsltFuncFunctionData *data,
     func = (exsltFuncFunctionData*)xmlHashLookup2(ch->hash, URI, name);
     if (func == NULL) {                /* Not yet present - copy it in */
        func = exsltFuncNewFunctionData();
+        if (func == NULL)
+            return;
        memcpy(func, data, sizeof(exsltFuncFunctionData));
        if (xmlHashAddEntry2(ch->hash, URI, name, func) < 0) {
            xsltGenericError(xsltGenericErrorContext,
@@ -494,6 +496,10 @@ exsltFuncFunctionComp (xsltStylesheetPtr style, xmlNodePtr inst) {
      * Create function data
      */
     func = exsltFuncNewFunctionData();
+    if (func == NULL) {
+        xmlFree(name);
+        return;
+    }
     func->content = inst->children;
     while (IS_XSLT_ELEM(func->content) &&
           IS_XSLT_NAME(func->content, "param")) {


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