int nargs);
static exsltFuncFunctionData *exsltFuncNewFunctionData(void);
+#define MAX_FUNC_RECURSION 1000
+
/*static const xmlChar *exsltResultDataID = (const xmlChar *) "EXSLT Result";*/
/**
"param == NULL\n");
return;
}
+ if (tctxt->funcLevel > MAX_FUNC_RECURSION) {
+ xsltGenericError(xsltGenericErrorContext,
+ "{%s}%s: detected a recursion\n",
+ ctxt->context->functionURI, ctxt->context->function);
+ ctxt->error = XPATH_MEMORY_ERROR;
+ return;
+ }
+ tctxt->funcLevel++;
+
/*
* We have a problem with the evaluation of function parameters.
* The original library code did not evaluate XPath expressions until
* the calling process exits.
*/
xsltExtensionInstructionResultFinalize(tctxt);
+ tctxt->funcLevel--;
}