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

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

Issue 1848793005: Roll libxslt to 891681e3e948f31732229f53cb6db7215f740fc7 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/date.c ('k') | third_party/libxslt/libexslt/strings.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libxslt/libexslt/functions.c
diff --git a/third_party/libxslt/libexslt/functions.c b/third_party/libxslt/libexslt/functions.c
index e6e245fd18fa2df6c81d804425d8fa9709d2d033..0795a13dadddc4cc632981813bb8a5751c1b72e4 100644
--- a/third_party/libxslt/libexslt/functions.c
+++ b/third_party/libxslt/libexslt/functions.c
@@ -112,6 +112,8 @@ exsltFuncRegisterImportFunc (exsltFuncFunctionData *data,
func = (exsltFuncFunctionData*)xmlHashLookup2(ch->hash, URI, name);
if (func == NULL) { /* Not yet present - copy it in */
func = exsltFuncNewFunctionData();
+ if (func == NULL)
+ return;
memcpy(func, data, sizeof(exsltFuncFunctionData));
if (xmlHashAddEntry2(ch->hash, URI, name, func) < 0) {
xsltGenericError(xsltGenericErrorContext,
@@ -301,6 +303,14 @@ exsltFuncFunctionFunction (xmlXPathParserContextPtr ctxt, int nargs) {
func = (exsltFuncFunctionData*) xmlHashLookup2 (data->funcs,
ctxt->context->functionURI,
ctxt->context->function);
+ if (func == NULL) {
+ /* Should never happen */
+ xsltGenericError(xsltGenericErrorContext,
+ "{%s}%s: not found\n",
+ ctxt->context->functionURI, ctxt->context->function);
+ ctxt->error = XPATH_UNKNOWN_FUNC_ERROR;
+ return;
+ }
/*
* params handling
@@ -494,6 +504,10 @@ exsltFuncFunctionComp (xsltStylesheetPtr style, xmlNodePtr inst) {
* Create function data
*/
func = exsltFuncNewFunctionData();
+ if (func == NULL) {
+ xmlFree(name);
+ return;
+ }
func->content = inst->children;
while (IS_XSLT_ELEM(func->content) &&
IS_XSLT_NAME(func->content, "param")) {
« no previous file with comments | « third_party/libxslt/libexslt/date.c ('k') | third_party/libxslt/libexslt/strings.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698