Skip to content

Commit

Permalink
V4L/DVB (12436): stk-webcam: read buffer overflow
Browse files Browse the repository at this point in the history
It tested the value of stk_sizes[i].m before checking whether i was in range.

Cc: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Roel Kluin authored and Mauro Carvalho Chehab committed Aug 13, 2009
1 parent 01a5fd6 commit 77f2c2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/media/video/stk-webcam.c
Original file line number Diff line number Diff line change
Expand Up @@ -1050,8 +1050,8 @@ static int stk_setup_format(struct stk_camera *dev)
depth = 1;
else
depth = 2;
while (stk_sizes[i].m != dev->vsettings.mode
&& i < ARRAY_SIZE(stk_sizes))
while (i < ARRAY_SIZE(stk_sizes) &&
stk_sizes[i].m != dev->vsettings.mode)
i++;
if (i == ARRAY_SIZE(stk_sizes)) {
STK_ERROR("Something is broken in %s\n", __func__);
Expand Down

0 comments on commit 77f2c2d

Please sign in to comment.