summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2009-12-13 11:53:04 -0800
committerJohan Dahlin <johan@gnome.org>2009-12-15 11:01:55 -0200
commiteef0abab4094bb6bc16cf186771dfb5ab39d7b16 (patch)
tree3bb5f19ff303711aaeb76f5f8404c668af17722b
parent8f252ababb6cb5948473636e4592f10ea1b8aebb (diff)
downloadgobject-introspection-eef0abab4094bb6bc16cf186771dfb5ab39d7b16.tar.gz
protect on null retval
ffi_call does not protect against retval being NULL, resulting in a segfault. https://bugzilla.gnome.org/show_bug.cgi?id=604472
-rw-r--r--girepository/ginvoke.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/girepository/ginvoke.c b/girepository/ginvoke.c
index 70d81f8e..136860c9 100644
--- a/girepository/ginvoke.c
+++ b/girepository/ginvoke.c
@@ -247,6 +247,7 @@ g_function_info_invoke (GIFunctionInfo *info,
if (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, n_invoke_args, rtype, atypes) != FFI_OK)
goto out;
+ g_return_val_if_fail (return_value, FALSE);
ffi_call (&cif, func, return_value, args);
if (local_error)
@@ -435,6 +436,7 @@ gi_cclosure_marshal_generic (GClosure *closure,
if (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, n_args, rtype, atypes) != FFI_OK)
return;
+ g_return_val_if_fail (rvalue, FALSE);
ffi_call (&cif, marshal_data ? marshal_data : cc->callback, rvalue, args);
if (return_gvalue && G_VALUE_TYPE (return_gvalue))