summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Francois Moine2009-11-24 10:13:28 +0100
committerMauro Carvalho Chehab2009-12-05 21:42:08 +0100
commit6afd2aa856eba0706176cecea1f989b1081c96dc (patch)
treeaed71aba53de8f42d2da61b2a783d0ed021589d1
parentV4L/DVB (13490): gspca - ov534: Add controls for sensor ov965x. (diff)
downloadkernel-qcow2-linux-6afd2aa856eba0706176cecea1f989b1081c96dc.tar.gz
kernel-qcow2-linux-6afd2aa856eba0706176cecea1f989b1081c96dc.tar.xz
kernel-qcow2-linux-6afd2aa856eba0706176cecea1f989b1081c96dc.zip
V4L/DVB (13491): gspca - vc032x: Avoid crash on querymenu.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/gspca/vc032x.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/video/gspca/vc032x.c b/drivers/media/video/gspca/vc032x.c
index 26675236fbd2..c090efcd8045 100644
--- a/drivers/media/video/gspca/vc032x.c
+++ b/drivers/media/video/gspca/vc032x.c
@@ -3095,6 +3095,8 @@ static int sd_querymenu(struct gspca_dev *gspca_dev,
switch (menu->id) {
case V4L2_CID_POWER_LINE_FREQUENCY:
+ if (menu->index >= ARRAY_SIZE(freq_nm))
+ break;
strcpy((char *) menu->name, freq_nm[menu->index]);
return 0;
}