From 76e3dc0ae30982584512126b364721c2cecb228e Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Mon, 13 Apr 2020 11:43:15 -0400 Subject: 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. --- rts/posix/Signals.c | 5 +++-- 1 file 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; -- cgit v1.2.1