Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: third_party/libxslt/libexslt/functions.c

Issue 661058: libxslt update (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/src/
Patch Set: '' Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/libxslt/libexslt/exsltconfig.h ('k') | third_party/libxslt/libexslt/libexslt.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libxslt/libexslt/functions.c
===================================================================
--- third_party/libxslt/libexslt/functions.c (revision 39981)
+++ third_party/libxslt/libexslt/functions.c (working copy)
@@ -57,6 +57,8 @@
int nargs);
static exsltFuncFunctionData *exsltFuncNewFunctionData(void);
+#define MAX_FUNC_RECURSION 1000
+
/*static const xmlChar *exsltResultDataID = (const xmlChar *) "EXSLT Result";*/
/**
@@ -321,6 +323,15 @@
"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
@@ -437,6 +448,7 @@
* the calling process exits.
*/
xsltExtensionInstructionResultFinalize(tctxt);
+ tctxt->funcLevel--;
}
« no previous file with comments | « third_party/libxslt/libexslt/exsltconfig.h ('k') | third_party/libxslt/libexslt/libexslt.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698