Skip to contentSkip to conversation

drivers/media/video/au0828/au0828-video.c: off by one bug

PATCH In review [email protected] 1 participant 1 message Apr 27, 2010 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 5/11 drivers/media/video/au0828/au0828-video.c: off by one bug

From: Dan Carpenter <[email protected]>

The "AUVI_INPUT(tmp)" macro uses "tmp" as an index of an array with AU0828_MAX_INPUT elements.

Cc Mauro Carvalho Chehab <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Hans Verkuil <[email protected]>

---

 drivers/media/video/au0828/au0828-video.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/video/au0828/au0828-video.c renamed from drivers/media/video/au0828/au0828-video.c~drivers-media-video-au0828-au0828-videoc-off-by-one-bug +1 -1
diff -puN drivers/media/video/au0828/au0828-video.c~drivers-media-video-au0828-au0828-videoc-off-by-one-bug drivers/media/video/au0828/au0828-video.c
@@ -1105,7 +1105,7 @@ static int vidioc_enum_input(struct file
 
 	tmp = input->index;
 
-	if (tmp > AU0828_MAX_INPUT)
+	if (tmp >= AU0828_MAX_INPUT)
 		return -EINVAL;
 	if (AUVI_INPUT(tmp).type == 0)
 		return -EINVAL;

_