[CRIU] [PATCH] restore: fix size of the parent_act array

Pavel Emelyanov xemul at parallels.com
Thu Aug 7 06:02:35 PDT 2014


On 08/07/2014 04:49 PM, Andrey Vagin wrote:
> SIGMAX is a valid value, so the size of the array must be SIGMAX + 1
> 
> Signed-off-by: Andrey Vagin <avagin at openvz.org>
> ---
>  cr-restore.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/cr-restore.c b/cr-restore.c
> index 1b538e1..b231ea8 100644
> --- a/cr-restore.c
> +++ b/cr-restore.c
> @@ -616,7 +616,7 @@ static int open_vmas(int pid)
>  }
>  
>  static rt_sigaction_t sigchld_act;
> -static rt_sigaction_t parent_act[SIGMAX];
> +static rt_sigaction_t parent_act[SIGMAX + 1];

Let's better access is with -1 on each index, since 0 is unused.

>  static bool sa_inherited(int sig, rt_sigaction_t *sa)
>  {
> 



More information about the CRIU mailing list