From: William M. Brack Date: Thu, 23 Dec 2004 08:08:11 +0000 (+0000) Subject: fixed a couple of spots where out-of-memory errors were not detected in X-Git-Tag: v1.1.28~348 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1c4cb3af748fb9810aaff51f8c07a6e45dbc8910;p=platform%2Fupstream%2Flibxslt.git fixed a couple of spots where out-of-memory errors were not detected in * 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) --- diff --git a/ChangeLog b/ChangeLog index ccac8b9..33db7f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Thu Dec 23 16:04:47 HKT 2004 William Brack + + * 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 *doc/xslt.html, doc/downloads.html: changed the download link diff --git a/libxslt/templates.c b/libxslt/templates.c index 9303da5..dca0633 100644 --- a/libxslt/templates.c +++ b/libxslt/templates.c @@ -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) diff --git a/libxslt/transform.c b/libxslt/transform.c index d4bcc97..273af3a 100644 --- a/libxslt/transform.c +++ b/libxslt/transform.c @@ -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 */ diff --git a/libxslt/xsltwin32config.h b/libxslt/xsltwin32config.h index f2dc77a..d0cb9cc 100644 --- a/libxslt/xsltwin32config.h +++ b/libxslt/xsltwin32config.h @@ -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: