]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
V4L/DVB: video/au0828: off by one bug
authorDan Carpenter <error27@gmail.com>
Sun, 28 Mar 2010 11:21:18 +0000 (08:21 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 19 May 2010 15:57:21 +0000 (12:57 -0300)
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>
drivers/media/video/au0828/au0828-video.c

index 8c140c01c5e62e05b155331936ebebd141efe865..66150216f976d0f99dc5397e379c2ee26b7dc767 100644 (file)
@@ -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;