diff options
author | Ben Gamari <ben@smart-cactus.org> | 2020-04-13 11:43:15 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-04-22 23:13:43 -0400 |
commit | 6f84aca31290afc11acde0f86969a535e519e1d5 (patch) | |
tree | 141e7d9af21cb132a47ff50f05bfa25e38f5dc2e | |
parent | ffde234854f49dba9ec4735aad74b30fd2deee29 (diff) | |
download | haskell-6f84aca31290afc11acde0f86969a535e519e1d5.tar.gz |
rts: Ensure that sigaction structs are initialized
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; |