Explorar o código

[LibOS] Copy signal handler's __kernel_sigaction in get_new_thread()

Previously, there was a bug in copy of the shim_thread::signal_handles[].action
due to sizeof on the wrong type (shim_signal_handle instead of __kernel_sigaction).
This led to incomplete action object in signal_handles[].
Isaku Yamahata %!s(int64=6) %!d(string=hai) anos
pai
achega
74ce0ae3e1
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      LibOS/shim/src/bookkeep/shim_thread.c

+ 1 - 1
LibOS/shim/src/bookkeep/shim_thread.c

@@ -206,7 +206,7 @@ struct shim_thread * get_new_thread (IDTYPE new_tid)
 
             thread->signal_handles[i].action =
                     malloc_copy(cur_thread->signal_handles[i].action,
-                                sizeof(struct shim_signal_handle));
+                                sizeof(*thread->signal_handles[i].action));
         }
 
         memcpy(&thread->signal_mask, &cur_thread->signal_mask,