* [PATCH] stk-webcam: Read buffer overflow
@ 2009-07-24 10:45 Roel Kluin
0 siblings, 0 replies; only message in thread
From: Roel Kluin @ 2009-07-24 10:45 UTC (permalink / raw)
To: mchehab, linux-media, Andrew Morton
It tested the value of stk_sizes[i].m before checking whether i was in range.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/media/video/stk-webcam.c b/drivers/media/video/stk-webcam.c
index 4d6785e..b154bd9 100644
--- a/drivers/media/video/stk-webcam.c
+++ b/drivers/media/video/stk-webcam.c
@@ -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__);
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-07-24 10:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-24 10:45 [PATCH] stk-webcam: Read buffer overflow Roel Kluin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox