added check in xsltCopyText to assure content is in dictionary before
authorWilliam M. Brack <wbrack@src.gnome.org>
Thu, 14 Jul 2005 05:52:20 +0000 (05:52 +0000)
committerWilliam M. Brack <wbrack@src.gnome.org>
Thu, 14 Jul 2005 05:52:20 +0000 (05:52 +0000)
* libxslt/transform.c: added check in xsltCopyText to assure
  content is in dictionary before doing a straight copy of
  content (bug 302821)

ChangeLog
libxslt/transform.c

index 5c654e1..10e116c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Jul 13 22:41:03 PDT 2005 William Brack <wbrack@mmm.com.hk>
+
+       * libxslt/transform.c: added check in xsltCopyText to assure
+         content is in dictionary before doing a straight copy of
+         content (bug 302821)
+
 Tue Jul 13 16:16:31 PDT 2005 William Brack <wbrack@mmm.com.hk>
 
        * libxslt/transform.c: fixed to set current default value for
index 38618d1..b56bdef 100644 (file)
@@ -730,7 +730,16 @@ xsltCopyText(xsltTransformContextPtr ctxt, xmlNodePtr target,
            return NULL;
        if (cur->name == xmlStringTextNoenc)
            copy->name = xmlStringTextNoenc;
-       copy->content = cur->content;
+       /*
+        * Must confirm that content is in dict
+        * (bug 302821)
+        */
+       if (xmlDictOwns(ctxt->dict, cur->content))
+           copy->content = cur->content;
+       else {
+           if ((copy->content = xmlStrdup(cur->content)) == NULL)
+               return NULL;
+       }
     } else {
         /*
         * normal processing. keep counters to extend the text node