From 54977ed7966847e305a2008cb18892df26eeb065 Mon Sep 17 00:00:00 2001 From: Chris Evans <cevans@chromium.org> Date: Mon, 03 Sep 2012 07:50:22 +0000 Subject: Fix a dictionary string usage Raised in chromium, but also affecting xsltproc --- diff --git a/libxslt/templates.c b/libxslt/templates.c index 169afd9..4804682 100644 --- a/libxslt/templates.c +++ b/libxslt/templates.c @@ -18,6 +18,7 @@ #include <libxml/globals.h> #include <libxml/xmlerror.h> #include <libxml/tree.h> +#include <libxml/dict.h> #include <libxml/xpathInternals.h> #include <libxml/parserInternals.h> #include "xslt.h" @@ -586,7 +587,8 @@ xsltAttrTemplateProcess(xsltTransformContextPtr ctxt, xmlNodePtr target, } } else if ((ctxt->internalized) && (target != NULL) && (target->doc != NULL) && - (target->doc->dict == ctxt->dict)) { + (target->doc->dict == ctxt->dict) && + xmlDictOwns(ctxt->dict, value)) { text->content = (xmlChar *) value; } else { text->content = xmlStrdup(value); @@ -772,7 +774,8 @@ xsltAttrListTemplateProcess(xsltTransformContextPtr ctxt, } } else if ((ctxt->internalized) && (target->doc != NULL) && - (target->doc->dict == ctxt->dict)) + (target->doc->dict == ctxt->dict) && + xmlDictOwns(ctxt->dict, value)) { text->content = (xmlChar *) value; } else { -- cgit v0.9.0.2