fixed a couple of spots where out-of-memory errors were not detected in
authorWilliam M. Brack <wbrack@src.gnome.org>
Thu, 23 Dec 2004 08:08:11 +0000 (08:08 +0000)
committerWilliam M. Brack <wbrack@src.gnome.org>
Thu, 23 Dec 2004 08:08:11 +0000 (08:08 +0000)
* libxslt/transform.c, libxslt/templates.c: fixed a couple of
  spots where out-of-memory errors were not detected in time
  (bug #153660 on OSF/1)

ChangeLog
libxslt/templates.c
libxslt/transform.c
libxslt/xsltwin32config.h

index ccac8b9..33db7f1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Thu Dec 23 16:04:47 HKT 2004 William Brack <wbrack@mmm.com.hk>
+
+       * libxslt/transform.c, libxslt/templates.c: fixed a couple of
+         spots where out-of-memory errors were not detected in time
+         (bug #153660 on OSF/1)
+         
 Thu Dec  2 21:10:31 HKT 2004 William Brack <wbrack@mmm.com.hk>
 
        *doc/xslt.html, doc/downloads.html: changed the download link
index 9303da5..dca0633 100644 (file)
@@ -438,7 +438,7 @@ xsltAttrTemplateProcess(xsltTransformContextPtr ctxt, xmlNodePtr target,
     const xmlChar *value;
     xmlNsPtr ns;
     xmlAttrPtr ret;
-    if ((ctxt == NULL) || (cur == NULL))
+    if ((ctxt == NULL) || (cur == NULL) || (target == NULL))
        return(NULL);
     
     if (cur->type != XML_ATTRIBUTE_NODE)
index d4bcc97..273af3a 100644 (file)
@@ -712,6 +712,8 @@ xsltCopyText(xsltTransformContextPtr ctxt, xmlNodePtr target,
            return(xsltAddTextString(ctxt, target->last, cur->content, len));
        }
        copy = xmlNewTextLen(cur->content, len);
+       if (copy == NULL)
+           return NULL;
        if (cur->name == xmlStringTextNoenc)
            copy->name = xmlStringTextNoenc;
        ctxt->lasttext = copy->content;
@@ -1656,7 +1658,8 @@ xsltApplyOneTemplateInt(xsltTransformContextPtr ctxt, xmlNodePtr node,
                                  cur->content));
             }
 #endif
-            xsltCopyText(ctxt, insert, cur);
+            if (xsltCopyText(ctxt, insert, cur) == NULL)
+               goto error;
         } else if ((cur->type == XML_ELEMENT_NODE) &&
                    (cur->ns != NULL) && (cur->psvi != NULL)) {
             xsltTransformFunction function;
@@ -1716,7 +1719,8 @@ xsltApplyOneTemplateInt(xsltTransformContextPtr ctxt, xmlNodePtr node,
                              "xsltApplyOneTemplate: copy node %s\n",
                              cur->name));
 #endif
-            copy = xsltCopyNode(ctxt, cur, insert);
+            if ((copy = xsltCopyNode(ctxt, cur, insert)) == NULL)
+               goto error;
             /*
              * all the attributes are directly inherited
              */
index f2dc77a..d0cb9cc 100644 (file)
@@ -44,7 +44,7 @@ extern "C" {
  *
  * extra version information, used to show a CVS compilation
  */
-#define LIBXML_VERSION_EXTRA "-CVS970"
+#define LIBXML_VERSION_EXTRA "-CVS975"
 
 /**
  * WITH_XSLT_DEBUG: