[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] exec.c: Initialize sa_flags passed to sigaction
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-devel] [PATCH] exec.c: Initialize sa_flags passed to sigaction() |
Date: |
Tue, 15 May 2018 17:53:10 -0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 |
On 05/15/2018 03:27 PM, Peter Maydell wrote:
> 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 <address@hidden>
> ---
> exec.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/exec.c b/exec.c
> index ffa1099547..bd8833fc9d 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -1124,6 +1124,7 @@ void cpu_abort(CPUState *cpu, const char *fmt, ...)
> struct sigaction act;
I'd have used the more generic:
struct sigaction act = { };
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
> sigfillset(&act.sa_mask);
> act.sa_handler = SIG_DFL;
> + act.sa_flags = 0;
> sigaction(SIGABRT, &act, NULL);
> }
> #endif
>