[lxc-devel] [PATCH 6/6] coverity: Don't pass uninitialized var to write

Serge Hallyn serge.hallyn at ubuntu.com
Sat Feb 15 00:03:56 UTC 2014


Quoting Stéphane Graber (stgraber at ubuntu.com):
> Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>

sigh.  guess we can't teach coverity to check that it doesn't matter.

Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>

> ---
>  src/tests/locktests.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/tests/locktests.c b/src/tests/locktests.c
> index 2d04052..dd3393a 100644
> --- a/src/tests/locktests.c
> +++ b/src/tests/locktests.c
> @@ -66,7 +66,7 @@ static void test_two_locks(void)
>  		fprintf(stderr, "%d; failed to get lock\n", __LINE__);
>  		exit(1);
>  	}
> -	if (write(p[1], &c, 1) < 0) {
> +	if (write(p[1], "a", 1) < 0) {
>  		perror("write");
>  		exit(1);
>  	}
> -- 
> 1.9.rc1
> 
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel


More information about the lxc-devel mailing list