From: Andy Walls Date: Fri, 24 Jul 2009 00:51:29 +0000 (-0300) Subject: V4L/DVB (12338): cx18: Read buffer overflow X-Git-Tag: v2.6.31-rc7~40^2~35 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=225aeb1c5863bc92c6bb1f921e9a6cf4d15dbb2a;p=~shefty%2Frdma-dev.git 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 Signed-off-by: Andy Walls Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/cx18/cx18-controls.c b/drivers/media/video/cx18/cx18-controls.c index 5136df19833..93f0dae0135 100644 --- a/drivers/media/video/cx18/cx18-controls.c +++ b/drivers/media/video/cx18/cx18-controls.c @@ -20,6 +20,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA */ +#include #include "cx18-driver.h" #include "cx18-cards.h" @@ -317,7 +318,7 @@ int cx18_s_ext_ctrls(struct file *file, void *fh, struct v4l2_ext_controls *c) idx = p.audio_properties & 0x03; /* The audio clock of the digitizer must match the codec sample rate otherwise you get some very strange effects. */ - if (idx < sizeof(freqs)) + if (idx < ARRAY_SIZE(freqs)) cx18_call_all(cx, audio, s_clock_freq, freqs[idx]); return err; }