lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 18 Mar 2010 07:37:22 -0400
From:	Andy Walls <awalls@...ix.net>
To:	Dan Carpenter <error27@...il.com>
Cc:	Mauro Carvalho Chehab <mchehab@...radead.org>,
	ivtv-devel@...vdriver.org, linux-media@...r.kernel.org,
	linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [patch] ivtv: sizeof() => ARRAY_SIZE()

On Wed, 2010-03-17 at 18:11 +0300, Dan Carpenter wrote:
> This fixes a smatch warning:
> drivers/media/video/ivtv/ivtv-vbi.c +138 ivtv_write_vbi(43) 
> 	error: buffer overflow 'vi->cc_payload' 256 <= 1023
> 
> Signed-off-by: Dan Carpenter <error27@...il.com>

Looks good.

Reviewed-by: Andy Walls <awalls@...ix.net>

And, if needed

Signed-off-by: Andy Walls <awalls@...ix.net>

Regards,
Andy

> diff --git a/drivers/media/video/ivtv/ivtv-vbi.c b/drivers/media/video/ivtv/ivtv-vbi.c
> index f420d31..d73af45 100644
> --- a/drivers/media/video/ivtv/ivtv-vbi.c
> +++ b/drivers/media/video/ivtv/ivtv-vbi.c
> @@ -134,7 +134,7 @@ void ivtv_write_vbi(struct ivtv *itv, const struct v4l2_sliced_vbi_data *sliced,
>  			}
>  		}
>  	}
> -	if (found_cc && vi->cc_payload_idx < sizeof(vi->cc_payload)) {
> +	if (found_cc && vi->cc_payload_idx < ARRAY_SIZE(vi->cc_payload)) {
>  		vi->cc_payload[vi->cc_payload_idx++] = cc;
>  		set_bit(IVTV_F_I_UPDATE_CC, &itv->i_flags);
>  	}
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ