diff options
author | MyoungJune Park <mj2004.park@samsung.com> | 2016-06-29 14:28:51 +0900 |
---|---|---|
committer | MyoungJune Park <mj2004.park@samsung.com> | 2016-06-29 14:29:13 +0900 |
commit | 8737843a4d457b79d3c6abbc17fbf97b81a8861e (patch) | |
tree | 6229a8587d64a3a76c297f63d3eead8ffb51a14d /libexslt/functions.c | |
parent | c3bb6b2f10204be6970bfbaa50f9e96e184d505f (diff) | |
parent | c582450a479ff157cf79aed26b6b08e867ff3832 (diff) | |
download | libxslt-8737843a4d457b79d3c6abbc17fbf97b81a8861e.tar.gz libxslt-8737843a4d457b79d3c6abbc17fbf97b81a8861e.tar.bz2 libxslt-8737843a4d457b79d3c6abbc17fbf97b81a8861e.zip |
Merge branch 'tizen_base' into tizen
Change-Id: I412621219c0ed82145d1a03b5bbe474646fcf0ef
Signed-off-by: MyoungJune Park <mj2004.park@samsung.com>
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")) { |