summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam M. Brack <wbrack@src.gnome.org>2008-03-15 03:17:05 +0000
committerWilliam M. Brack <wbrack@src.gnome.org>2008-03-15 03:17:05 +0000
commite31e904dc21e346dc062b60ab7dbe082f6e7c3a3 (patch)
tree34b34b7f480e37e71259837ea911e2c092c2eb3b
parent30b6586f552f750569a6354bbc9827b1f65ae6fb (diff)
downloadlibxslt-e31e904dc21e346dc062b60ab7dbe082f6e7c3a3.tar.gz
libxslt-e31e904dc21e346dc062b60ab7dbe082f6e7c3a3.tar.bz2
libxslt-e31e904dc21e346dc062b60ab7dbe082f6e7c3a3.zip
*libexslt/functions.c: fixed minor error reported on the mailing
list by Mark Howe, which caused a segfault if func:result was postitioned as top-level element. svn path=/trunk/; revision=1460
-rw-r--r--ChangeLog6
-rw-r--r--libexslt/functions.c11
2 files changed, 15 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 8e702e86..327506af 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sat Mar 15 11:13:18 HKT 2008 William Brack <wbrack@mmm.com.hk>
+
+ *libexslt/functions.c: fixed minor error reported on the mailing
+ list by Mark Howe, which caused a segfault if func:result was
+ postitioned as top-level element.
+
Thu Mar 13 09:33:21 CET 2008 Daniel Veillard <daniel@veillard.com>
* libxslt/win32config.h: patch from Rob Richards for VS 2008
diff --git a/libexslt/functions.c b/libexslt/functions.c
index e7ae02bd..bef4a5a4 100644
--- a/libexslt/functions.c
+++ b/libexslt/functions.c
@@ -559,6 +559,13 @@ exsltFuncResultComp (xsltStylesheetPtr style, xmlNodePtr inst,
* instanciation of a func:result element.
*/
for (test = inst->parent; test != NULL; test = test->parent) {
+ if (IS_XSLT_ELEM(test) &&
+ IS_XSLT_NAME(test, "stylesheet")) {
+ xsltGenericError(xsltGenericErrorContext,
+ "func:result element not a descendant "
+ "of a func:function\n");
+ return (NULL);
+ }
if ((test->ns != NULL) &&
(xmlStrEqual(test->ns->href, EXSLT_FUNCTIONS_NAMESPACE))) {
if (xmlStrEqual(test->name, (const xmlChar *) "function")) {
@@ -657,8 +664,8 @@ exsltFuncResultElem (xsltTransformContextPtr ctxt,
*/
if (inst->children != NULL) {
xsltGenericError(xsltGenericErrorContext,
- "func:result content must be empty if it"
- " has a select attribute\n");
+ "func:result content must be empty if"
+ " the function has a select attribute\n");
data->error = 1;
return;
}