summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2009-08-11 05:07:54 +0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-08-14 03:39:14 +0400
commitbb2b4542b6415044894cd7c147ff54840dd8ed3f (patch)
tree6c2157ea5d794ea3b904132be2f9d3f96096552a
parent27059b35397fc7cf2cbf5b4b99d912bbc06aff4d (diff)
downloadlinux-bb2b4542b6415044894cd7c147ff54840dd8ed3f.tar.xz
V4L/DVB (12438): Read buffer overflow
parport[n] is checked before n < MAX_CAMS Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/bw-qcam.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/video/bw-qcam.c b/drivers/media/video/bw-qcam.c
index 10dbd4a11b30..9e39bc5f7b00 100644
--- a/drivers/media/video/bw-qcam.c
+++ b/drivers/media/video/bw-qcam.c
@@ -992,7 +992,7 @@ static int accept_bwqcam(struct parport *port)
if (parport[0] && strncmp(parport[0], "auto", 4) != 0) {
/* user gave parport parameters */
- for(n=0; parport[n] && n<MAX_CAMS; n++){
+ for (n = 0; n < MAX_CAMS && parport[n]; n++) {
char *ep;
unsigned long r;
r = simple_strtoul(parport[n], &ep, 0);