stk-webcam: read buffer overflow
PATCH 7/9 stk-webcam: read buffer overflow
From: Roel Kluin <[email protected]>
It tested the value of stk_sizes[i].m before checking whether i was in range.
Signed-off-by Roel Kluin <[email protected]>
Cc Mauro Carvalho Chehab <[email protected]>
Cc Hans Verkuil <[email protected]>
Cc Trent Piepho <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
drivers/media/video/stk-webcam.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/video/stk-webcam.c renamed from drivers/media/video/stk-webcam.c~stk-webcam-read-buffer-overflow +2 -2
@@ -1050,8 +1050,8 @@ static int stk_setup_format(struct stk_c 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__);
_