diff options
author | Andy Walls <awalls@radix.net> | 2009-07-23 20:51:29 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-08-13 19:39:02 -0400 |
commit | 225aeb1c5863bc92c6bb1f921e9a6cf4d15dbb2a (patch) | |
tree | 1488e271a171fdbaacf2eaa19f894bf1b7f1b011 /drivers/media | |
parent | ed18d0c87ee0ab6e0985d83c19cd135b1bd54998 (diff) |
V4L/DVB (12338): cx18: Read buffer overflow
This mistakenly tested against sizeof(freqs) instead of the array size. Due to
the mask the only illegal value possible was 3.
Reported-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/cx18/cx18-controls.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/video/cx18/cx18-controls.c b/drivers/media/video/cx18/cx18-controls.c index 5136df198338..93f0dae01350 100644 --- a/drivers/media/video/cx18/cx18-controls.c +++ b/drivers/media/video/cx18/cx18-controls.c | |||
@@ -20,6 +20,7 @@ | |||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
21 | * 02111-1307 USA | 21 | * 02111-1307 USA |
22 | */ | 22 | */ |
23 | #include <linux/kernel.h> | ||
23 | 24 | ||
24 | #include "cx18-driver.h" | 25 | #include "cx18-driver.h" |
25 | #include "cx18-cards.h" | 26 | #include "cx18-cards.h" |
@@ -317,7 +318,7 @@ int cx18_s_ext_ctrls(struct file *file, void *fh, struct v4l2_ext_controls *c) | |||
317 | idx = p.audio_properties & 0x03; | 318 | idx = p.audio_properties & 0x03; |
318 | /* The audio clock of the digitizer must match the codec sample | 319 | /* The audio clock of the digitizer must match the codec sample |
319 | rate otherwise you get some very strange effects. */ | 320 | rate otherwise you get some very strange effects. */ |
320 | if (idx < sizeof(freqs)) | 321 | if (idx < ARRAY_SIZE(freqs)) |
321 | cx18_call_all(cx, audio, s_clock_freq, freqs[idx]); | 322 | cx18_call_all(cx, audio, s_clock_freq, freqs[idx]); |
322 | return err; | 323 | return err; |
323 | } | 324 | } |