X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fgears%2Fext_execve_hook.c;h=8c268674fd052efd414166c219a94cfb74619fb5;hb=25569fd796d1e1bb160b1b25ece9d4d3422720be;hp=aa5bce266557b04f62ec58de2cffdf4836fe5894;hpb=7229981629c6baa0afb61cc99cfcf6dd029c9c93;p=palacios.git diff --git a/palacios/src/gears/ext_execve_hook.c b/palacios/src/gears/ext_execve_hook.c index aa5bce2..8c26867 100644 --- a/palacios/src/gears/ext_execve_hook.c +++ b/palacios/src/gears/ext_execve_hook.c @@ -56,7 +56,7 @@ static int init_exec_hooks (struct v3_vm_info * vm, v3_cfg_tree_t * cfg, void ** return 0; } -static int init_exec_hooks_core (struct guest_info * core, void * priv_data) { +static int init_exec_hooks_core (struct guest_info * core, void * priv_data, void ** core_data) { struct v3_exec_hooks * hooks = &exec_hooks; INIT_LIST_HEAD(&(hooks->hook_list)); hooks->bin_table = v3_create_htable(0, exec_hash_fn, exec_eq_fn); @@ -76,7 +76,7 @@ static int init_exec_hooks_core (struct guest_info * core, void * priv_data) { return 0; } -static int deinit_exec_hooks_core (struct guest_info * core, void * priv_data) { +static int deinit_exec_hooks_core (struct guest_info * core, void * priv_data, void * core_data) { struct v3_exec_hooks * hooks = &exec_hooks; struct exec_hook * hook = NULL; struct exec_hook * tmp = NULL; @@ -99,6 +99,11 @@ int v3_hook_executable (struct v3_vm_info * vm, struct exec_hook * hook = V3_Malloc(sizeof(struct exec_hook)); struct v3_exec_hooks * hooks = &exec_hooks; addr_t key; + + if (!hook) { + PrintError("Cannot allocate in hooking exec\n"); + return -1; + } memset(hook, 0, sizeof(struct exec_hook));