diff options
author | William M. Brack <wbrack@src.gnome.org> | 2004-12-23 08:08:11 +0000 |
---|---|---|
committer | William M. Brack <wbrack@src.gnome.org> | 2004-12-23 08:08:11 +0000 |
commit | 1c4cb3af748fb9810aaff51f8c07a6e45dbc8910 (patch) | |
tree | dae674f218d8536401a55fd44ab69bd299ae3692 | |
parent | 19b29bdb69b00e4d2766430ab8e8d98f38a68876 (diff) | |
download | libxslt-1c4cb3af748fb9810aaff51f8c07a6e45dbc8910.tar.gz libxslt-1c4cb3af748fb9810aaff51f8c07a6e45dbc8910.tar.bz2 libxslt-1c4cb3af748fb9810aaff51f8c07a6e45dbc8910.zip |
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)
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | libxslt/templates.c | 2 | ||||
-rw-r--r-- | libxslt/transform.c | 8 | ||||
-rw-r--r-- | libxslt/xsltwin32config.h | 2 |
4 files changed, 14 insertions, 4 deletions
@@ -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 diff --git a/libxslt/templates.c b/libxslt/templates.c index 9303da58..dca06337 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 d4bcc974..273af3a5 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 f2dc77a8..d0cb9cc3 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: |