Skip to content

Commit

Permalink
V4L/DVB: video/au0828: off by one bug
Browse files Browse the repository at this point in the history
The "AUVI_INPUT(tmp)" macro uses "tmp" as an index of an array with
AU0828_MAX_INPUT elements.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Dan Carpenter authored and Mauro Carvalho Chehab committed May 19, 2010
1 parent 6e1f4df commit f5e20c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/video/au0828/au0828-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,7 @@ static int vidioc_enum_input(struct file *file, void *priv,

tmp = input->index;

if (tmp > AU0828_MAX_INPUT)
if (tmp >= AU0828_MAX_INPUT)
return -EINVAL;
if (AUVI_INPUT(tmp).type == 0)
return -EINVAL;
Expand Down

0 comments on commit f5e20c3

Please sign in to comment.