From 771cd2439f8675af4e8a0cd1346a6027756d756c Mon Sep 17 00:00:00 2001 From: Chris Evans <cevans@chromium.org> Date: Mon, 3 Sep 2012 21:52:14 +0800 Subject: [PATCH] Fix a dictionary string usage To: libvir-list@redhat.com Heap-double-free in xmlFreeNodeList http://code.google.com/p/chromium/issues/detail?id=144799 Raised in chromium, but also affecting xsltproc Cherry-pick of upstream commit, only one chunk can be applied Signed-off-by: Daniel Veillard <veillard@redhat.com> --- libxslt/templates.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libxslt/templates.c b/libxslt/templates.c index d6dc728..63908dd 100644 --- a/libxslt/templates.c +++ b/libxslt/templates.c @@ -511,7 +511,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); -- 1.7.11.4