[CRIU] [PATCH 1/2] fix coverity false positive

Tycho Andersen tycho.andersen at canonical.com
Fri Feb 5 15:17:10 PST 2016


On Fri, Feb 05, 2016 at 12:29:35PM -0700, Tycho Andersen wrote:
> As mentioned in #110 on github, I think coverity's complaint here is
> actually a false positive, since there's no way for render_lsm_profile to
> return non-zero when rendered == NULL. That said, this should fix the
> complaint by the static analyzer.

Oh, whoops. As Andrey points out in #110, this is actually possible,
and the patch should be different. I'll resend the series.

Tycho

> Closes #110
> 
> Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
> ---
>  cr-restore.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/cr-restore.c b/cr-restore.c
> index 3254efc..15bac79 100644
> --- a/cr-restore.c
> +++ b/cr-restore.c
> @@ -2835,7 +2835,7 @@ rst_prep_creds_args(CredsEntry *ce, unsigned long *prev_pos)
>  			size_t lsm_profile_len;
>  			char *lsm_profile;
>  
> -			if (render_lsm_profile(profile, &rendered))
> +			if (render_lsm_profile(profile, &rendered) || !rendered)
>  				return ERR_PTR(-EINVAL);
>  
>  			args->mem_lsm_profile_pos = rst_mem_cpos(RM_PRIVATE);
> -- 
> 2.5.0
> 


More information about the CRIU mailing list