mirror of
https://gitlab.gnome.org/GNOME/libxslt
synced 2025-08-08 21:42:07 +03:00
Check return value of exsltFuncNewFunctionData
Fixes bug #735957. https://bugzilla.gnome.org/show_bug.cgi?id=735957 Thanks to Prabhat Kanth for the report.
This commit is contained in:
@@ -112,6 +112,8 @@ exsltFuncRegisterImportFunc (exsltFuncFunctionData *data,
|
|||||||
func = (exsltFuncFunctionData*)xmlHashLookup2(ch->hash, URI, name);
|
func = (exsltFuncFunctionData*)xmlHashLookup2(ch->hash, URI, name);
|
||||||
if (func == NULL) { /* Not yet present - copy it in */
|
if (func == NULL) { /* Not yet present - copy it in */
|
||||||
func = exsltFuncNewFunctionData();
|
func = exsltFuncNewFunctionData();
|
||||||
|
if (func == NULL)
|
||||||
|
return;
|
||||||
memcpy(func, data, sizeof(exsltFuncFunctionData));
|
memcpy(func, data, sizeof(exsltFuncFunctionData));
|
||||||
if (xmlHashAddEntry2(ch->hash, URI, name, func) < 0) {
|
if (xmlHashAddEntry2(ch->hash, URI, name, func) < 0) {
|
||||||
xsltGenericError(xsltGenericErrorContext,
|
xsltGenericError(xsltGenericErrorContext,
|
||||||
@@ -494,6 +496,10 @@ exsltFuncFunctionComp (xsltStylesheetPtr style, xmlNodePtr inst) {
|
|||||||
* Create function data
|
* Create function data
|
||||||
*/
|
*/
|
||||||
func = exsltFuncNewFunctionData();
|
func = exsltFuncNewFunctionData();
|
||||||
|
if (func == NULL) {
|
||||||
|
xmlFree(name);
|
||||||
|
return;
|
||||||
|
}
|
||||||
func->content = inst->children;
|
func->content = inst->children;
|
||||||
while (IS_XSLT_ELEM(func->content) &&
|
while (IS_XSLT_ELEM(func->content) &&
|
||||||
IS_XSLT_NAME(func->content, "param")) {
|
IS_XSLT_NAME(func->content, "param")) {
|
||||||
|
Reference in New Issue
Block a user