summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@redhat.com>2009-09-18 11:43:35 +0200
committerDaniel Veillard <veillard@redhat.com>2009-09-18 11:43:35 +0200
commitf44c92bfb91695ccfffd95b7e358c8740d413b19 (patch)
tree28b48defa41b03df8ec677a1ca26a9f092598cf4
parent51f625a10a828b8cb8cd87aa171a3c1d9049c72c (diff)
downloadlibxslt-f44c92bfb91695ccfffd95b7e358c8740d413b19.tar.gz
Fix a crash on misformed imported stylesheets
* libxslt/preproc.c: handle the case where xsl:template parent is not an element.
-rw-r--r--libxslt/preproc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libxslt/preproc.c b/libxslt/preproc.c
index 9a5e9d69..b47d8099 100644
--- a/libxslt/preproc.c
+++ b/libxslt/preproc.c
@@ -82,7 +82,7 @@ xsltCheckTopLevelElement(xsltStylesheetPtr style, xmlNodePtr inst, int err) {
}
return(0);
}
- if ((parent->ns == NULL) ||
+ if ((parent->ns == NULL) || (parent->type != XML_ELEMENT_NODE) ||
((parent->ns != inst->ns) &&
(!xmlStrEqual(parent->ns->href, inst->ns->href))) ||
((!xmlStrEqual(parent->name, BAD_CAST "stylesheet")) &&