fixing bug #120684 on crash caused by text between apply-templates
authorWilliam M. Brack <wbrack@src.gnome.org>
Wed, 3 Sep 2003 01:22:15 +0000 (01:22 +0000)
committerWilliam M. Brack <wbrack@src.gnome.org>
Wed, 3 Sep 2003 01:22:15 +0000 (01:22 +0000)
* transform.c: fixing bug #120684 on crash caused by text between
  apply-templates

ChangeLog
libxslt/transform.c

index 296508d..9d7df76 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Sep  2 18:22:46 PDT 2003 William Brack <wbrack@mmm.com.hk>
+
+       * transform.c: fixing bug #120684 on crash caused by text between
+         apply-templates
+
 Tue Sep  2 16:05:37 CEST 2003 Igor Zlatkovic <igor@zlatkovic.com>
 
        * libxslt/xsltexports.h libexslt/exsltexports.h: defined additional 
index 4f2ec93..279842d 100644 (file)
@@ -1131,6 +1131,7 @@ xsltDefaultProcessOneNode(xsltTransformContextPtr ctxt, xmlNodePtr node,
                copy = xmlCopyNode(cur, 0);
                if (copy != NULL) {
                    xmlAddChild(ctxt->insert, copy);
+                   ctxt->lasttext = NULL;      /* AddChild may truncate buf */
                } else {
                    xsltTransformError(ctxt, NULL, node,
                     "xsltDefaultProcessOneNode: text copy failed\n");
@@ -1311,7 +1312,7 @@ xsltProcessOneNode(xsltTransformContextPtr ctxt, xmlNodePtr node,
                   xsltStackElemPtr params) {
     xsltTemplatePtr template;
     xmlNodePtr oldNode;
-
+    
     template = xsltGetTemplate(ctxt, node, NULL);
     /*
      * If no template is found, apply the default rule.