diff options
author | Ben Gamari <ben@smart-cactus.org> | 2020-04-13 11:43:15 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2020-04-13 11:43:15 -0400 |
commit | 76e3dc0ae30982584512126b364721c2cecb228e (patch) | |
tree | 314b43d6755ef3fb3b8bdecd98ab195d6b6e2276 | |
parent | 75a185dc2a648ab1f592d401daa5efcacb451c83 (diff) | |
download | haskell-wip/T18037.tar.gz |
rts: Ensure that sigaction structs are initializedwip/T18037
I noticed these may have uninitialized fields when looking into #18037.
The reporter says that zeroing them doesn't fix the MSAN failures they
observe but zeroing them is the right thing to do regardless.
-rw-r--r-- | rts/posix/Signals.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/rts/posix/Signals.c b/rts/posix/Signals.c index f8bd9fb829..2e534042f3 100644 --- a/rts/posix/Signals.c +++ b/rts/posix/Signals.c @@ -624,7 +624,7 @@ set_sigtstp_action (bool handle) void install_vtalrm_handler(int sig, TickProc handle_tick) { - struct sigaction action; + struct sigaction action = {}; action.sa_handler = handle_tick; @@ -666,7 +666,8 @@ install_vtalrm_handler(int sig, TickProc handle_tick) void initDefaultHandlers(void) { - struct sigaction action,oact; + struct sigaction action = {}; + struct sigaction oact = {}; // install the SIGINT handler action.sa_handler = shutdown_handler; |