[libxslt] Fix a crash on misformed imported stylesheets
- From: Daniel Veillard <veillard src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [libxslt] Fix a crash on misformed imported stylesheets
- Date: Fri, 18 Sep 2009 09:44:51 +0000 (UTC)
commit f44c92bfb91695ccfffd95b7e358c8740d413b19
Author: Daniel Veillard <veillard redhat com>
Date: Fri Sep 18 11:43:35 2009 +0200
Fix a crash on misformed imported stylesheets
* libxslt/preproc.c: handle the case where xsl:template parent
is not an element.
libxslt/preproc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/libxslt/preproc.c b/libxslt/preproc.c
index 9a5e9d6..b47d809 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")) &&
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]