Commit 07c31851 authored by mahendra.n's avatar mahendra.n Committed by Nick Wellnhofer

Fix possible NULL pointer deref in transform.c

Second part of fix for bug #757665.

https://bugzilla.gnome.org/show_bug.cgi?id=757665
parent f4611ecb
......@@ -1320,6 +1320,11 @@ xsltShallowCopyElem(xsltTransformContextPtr ctxt, xmlNodePtr node,
if (copy != NULL) {
copy->doc = ctxt->output;
copy = xsltAddChild(insert, copy);
if (copy == NULL) {
xsltTransformError(ctxt, NULL, node,
"xsltShallowCopyElem: copy failed\n");
return (copy);
}
if (node->type == XML_ELEMENT_NODE) {
/*
......@@ -1653,6 +1658,11 @@ xsltCopyTreeInternal(xsltTransformContextPtr ctxt,
if (copy != NULL) {
copy->doc = ctxt->output;
copy = xsltAddChild(insert, copy);
if (copy == NULL) {
xsltTransformError(ctxt, NULL, invocNode,
"xsltCopyTreeInternal: Copying of '%s' failed.\n", node->name);
return (copy);
}
/*
* The node may have been coalesced into another text node.
*/
......@@ -4132,6 +4142,11 @@ xsltElement(xsltTransformContextPtr ctxt, xmlNodePtr node,
return;
}
copy = xsltAddChild(ctxt->insert, copy);
if (copy == NULL) {
xsltTransformError(ctxt, NULL, inst,
"xsl:element : xsltAddChild failed\n");
return;
}
/*
* Namespace
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment