libxslt r1460 - in trunk: . libexslt



Author: wbrack
Date: Sat Mar 15 03:17:05 2008
New Revision: 1460
URL: http://svn.gnome.org/viewvc/libxslt?rev=1460&view=rev

Log:
*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.

Modified:
   trunk/ChangeLog
   trunk/libexslt/functions.c

Modified: trunk/libexslt/functions.c
==============================================================================
--- trunk/libexslt/functions.c	(original)
+++ trunk/libexslt/functions.c	Sat Mar 15 03:17:05 2008
@@ -559,6 +559,13 @@
      * 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 @@
 	 */
 	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;
 	}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]