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

Kirill Tkhai ktkhai at virtuozzo.com
Thu Mar 22 16:52:14 MSK 2018


On 22.03.2018 16:39, 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>

Reviewed-by: Kirill Tkhai <ktkhai 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;
>  	}
>  
> 


More information about the CRIU mailing list