OSDN Git Service

exec.c: Initialize sa_flags passed to sigaction()
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 15 May 2018 18:27:00 +0000 (19:27 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 1 Jun 2018 13:13:46 +0000 (15:13 +0200)
Coverity points out that in the user-only version of cpu_abort() we
call sigaction() with a partially initialized struct sigaction
(CID 1005351). Correct the omission.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20180515182700.31736-1-peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
exec.c

diff --git a/exec.c b/exec.c
index ffa1099..bd8833f 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -1124,6 +1124,7 @@ void cpu_abort(CPUState *cpu, const char *fmt, ...)
         struct sigaction act;
         sigfillset(&act.sa_mask);
         act.sa_handler = SIG_DFL;
+        act.sa_flags = 0;
         sigaction(SIGABRT, &act, NULL);
     }
 #endif