]> granicus.if.org Git - strace/commitdiff
Properly initialize siginfo_t object passed to print_stopped function
authorDmitry V. Levin <ldv@altlinux.org>
Fri, 18 Sep 2015 13:04:02 +0000 (13:04 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 19 Sep 2015 01:04:48 +0000 (04:04 +0300)
* strace.c (trace): Clear the whole siginfo_t variable before passing it
to ptrace(PTRACE_GETSIGINFO) because the latter may initialize only a
part of the structure.

strace.c

index 9b93e7968dbb632294328a4abdf6acb867d4529a..d610f707497cb795821c6453a47b46cb29058fc3 100644 (file)
--- a/strace.c
+++ b/strace.c
@@ -2194,7 +2194,7 @@ trace(void)
        }
 
        if (sig != syscall_trap_sig) {
-               siginfo_t si;
+               siginfo_t si = {};
 
                /*
                 * True if tracee is stopped by signal