[CRIU] [PATCH] unix: Fix nil dereference in find_queuer_for

Andrey Vagin avagin at virtuozzo.com
Fri Mar 23 00:48:55 MSK 2018


Applied, thanks

On Thu, Mar 22, 2018 at 04:39:34PM +0300, Cyrill Gorcunov wrote:
> When walking over unix sockets make sure the
> queuer is present before accessing it.
> 
> https://jira.sw.ru/browse/PSBM-82796
> 
> Reported-by: Vitaly Ostrosablin <vostrosablin at virtuozzo.com>
> Signed-off-by: Cyrill Gorcunov <gorcunov at virtuozzo.com>
> ---
>  criu/sk-unix.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/criu/sk-unix.c b/criu/sk-unix.c
> index 7f743a9b1..4d1f296f9 100644
> --- a/criu/sk-unix.c
> +++ b/criu/sk-unix.c
> @@ -958,7 +958,7 @@ static struct unix_sk_info *find_queuer_for(int id)
>  	struct unix_sk_info *ui;
>  
>  	list_for_each_entry(ui, &unix_sockets, list) {
> -		if (ui->queuer->ue->id == id)
> +		if (ui->queuer && ui->queuer->ue->id == id)
>  			return ui;
>  	}
>  
> -- 
> 2.14.3
> 


More information about the CRIU mailing list