Commit fd675976 authored by Nick Wellnhofer's avatar Nick Wellnhofer

Check return value of exsltFuncNewFunctionData

Fixes bug #735957.

https://bugzilla.gnome.org/show_bug.cgi?id=735957

Thanks to Prabhat Kanth for the report.
parent 35caed04
......@@ -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,
......@@ -494,6 +496,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")) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment