From 55379ef26269ac25921c441cda2dc82372eeacd7 Mon Sep 17 00:00:00 2001 From: "William M. Brack" Date: Thu, 14 Jul 2005 05:52:20 +0000 Subject: [PATCH] added check in xsltCopyText to assure content is in dictionary before * libxslt/transform.c: added check in xsltCopyText to assure content is in dictionary before doing a straight copy of content (bug 302821) --- ChangeLog | 6 ++++++ libxslt/transform.c | 11 ++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5c654e1..10e116c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Jul 13 22:41:03 PDT 2005 William Brack + + * 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 * libxslt/transform.c: fixed to set current default value for diff --git a/libxslt/transform.c b/libxslt/transform.c index 38618d1..b56bdef 100644 --- a/libxslt/transform.c +++ b/libxslt/transform.c @@ -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 -- 2.7.4