Skip to content

Commit b8f7882

Browse files
jmberg-intelrichardweinberger
authored andcommitted
um: Avoid using uninitialized regs
In timer_real_alarm_handler(), regs is only initialized if the context argument is non-NULL, also initialize in the other case. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Acked-by: Anton Ivanov <anton.ivanov@cambridgegreys.co.uk> Signed-off-by: Richard Weinberger <richard@nod.at>
1 parent 68c15a2 commit b8f7882

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎arch/um/os-Linux/signal.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <stdarg.h>
1111
#include <errno.h>
1212
#include <signal.h>
13+
#include <string.h>
1314
#include <strings.h>
1415
#include <as-layout.h>
1516
#include <kern_util.h>
@@ -88,6 +89,8 @@ static void timer_real_alarm_handler(mcontext_t *mc)
8889

8990
if (mc != NULL)
9091
get_regs_from_mc(&regs, mc);
92+
else
93+
memset(&regs, 0, sizeof(regs));
9194
timer_handler(SIGALRM, NULL, &regs);
9295
}
9396

0 commit comments

Comments
 (0)