diff options
author | MyoungJune Park <mj2004.park@samsung.com> | 2016-06-28 19:02:02 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@review.vlan103.tizen.org> | 2016-06-28 19:02:02 -0700 |
commit | 9f437f121e0a3f95f2f73a2fb94129df473ce6c7 (patch) | |
tree | be58f256e24304bccfdc6329d96567dcd6b8d877 /libexslt/functions.c | |
parent | 925059ca6aa063c9640e82ad4f40be2e38959aa8 (diff) | |
parent | 0f3d43b0708f1e7a1a1826b2e4d310c86f086078 (diff) | |
download | libxslt-9f437f121e0a3f95f2f73a2fb94129df473ce6c7.tar.gz libxslt-9f437f121e0a3f95f2f73a2fb94129df473ce6c7.tar.bz2 libxslt-9f437f121e0a3f95f2f73a2fb94129df473ce6c7.zip |
Merge "Rebase for libxslt-1.1.29" into tizen_base
Diffstat (limited to 'libexslt/functions.c')
-rw-r--r-- | libexslt/functions.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libexslt/functions.c b/libexslt/functions.c index e6e245fd..0795a13d 100644 --- a/libexslt/functions.c +++ b/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")) { |