diff options
author | William M. Brack <wbrack@src.gnome.org> | 2008-03-15 03:17:05 +0000 |
---|---|---|
committer | William M. Brack <wbrack@src.gnome.org> | 2008-03-15 03:17:05 +0000 |
commit | e31e904dc21e346dc062b60ab7dbe082f6e7c3a3 (patch) | |
tree | 34b34b7f480e37e71259837ea911e2c092c2eb3b /libexslt | |
parent | 30b6586f552f750569a6354bbc9827b1f65ae6fb (diff) | |
download | libxslt-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
Diffstat (limited to 'libexslt')
-rw-r--r-- | libexslt/functions.c | 11 |
1 files changed, 9 insertions, 2 deletions
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; } |