Commit 08fdc458 authored by Tommi Rantala's avatar Tommi Rantala

Zero initialize struct sigaction before sigaction()

Ensure no garbage in struct sigaction.
Valgrind was complaining:

==21435== Syscall param rt_sigaction(act->sa_mask) points to uninitialised byte(s)
==21435==    at 0x95ED000: __libc_sigaction (in /usr/lib64/libc-2.27.so)
==21435==    by 0x594E99: main
==21435==  Address 0x1ffefff8e8 is on thread 1's stack
==21435==  in frame #0, created by __libc_sigaction (???:)
parent b4e9a82c
......@@ -180,7 +180,7 @@ int main(int argc, char *argv[])
return 0;
// Empty signal handler for cleanly terminating the program
struct sigaction act;
struct sigaction act = {};
act.sa_handler = [](int) { };
sigaction(SIGINT, &act, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment