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 <[email protected]>

Looks good.

Reviewed-by: Andy Walls <[email protected]>

And, if needed

Signed-off-by: Andy Walls <[email protected]>

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);
>       }
> 


_______________________________________________
ivtv-devel mailing list
[email protected]
http://ivtvdriver.org/mailman/listinfo/ivtv-devel

Reply via email to