summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin <gzlist@googlemail.com>2009-09-16 19:02:16 +0200
committerDaniel Veillard <veillard@redhat.com>2009-09-16 19:02:16 +0200
commit7089a62b8f133b42a2981cf1f920a8b3fe9a8caa (patch)
tree1bcecb2e8b758512d7361c508758c06488bd20a6
parenta1fff8aaf099c294b6d3a757dbb4b06bfd42674a (diff)
downloadlibxslt-7089a62b8f133b42a2981cf1f920a8b3fe9a8caa.tar.gz
Crash compiling stylesheet with DTD
* libxslt/xslt.c: when a stylesheet embbeds a DTD the compilation process could get seriously wrong
-rw-r--r--libxslt/xslt.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libxslt/xslt.c b/libxslt/xslt.c
index 00f264fa..c289a9ff 100644
--- a/libxslt/xslt.c
+++ b/libxslt/xslt.c
@@ -4940,13 +4940,14 @@ xsltParseTemplateContent(xsltStylesheetPtr style, xmlNodePtr templ) {
* okay this is an extension element compile it too
*/
xsltStylePreCompute(style, cur);
- } else {
+ }
+ else if (cur->type == XML_ELEMENT_NODE)
+ {
/*
* This is an element which will be output as part of the
* template exectution, precompile AVT if found.
*/
- if ((cur->ns == NULL) && (style->defaultAlias != NULL) &&
- (cur->type == XML_ELEMENT_NODE)) {
+ if ((cur->ns == NULL) && (style->defaultAlias != NULL)) {
cur->ns = xmlSearchNsByHref(cur->doc, cur,
style->defaultAlias);
}