summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-04-28 19:03:59 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-04-30 14:26:42 -0300
commit82e3b88b679049f043fe9b03991d6d66fc0a43c8 (patch)
tree0824499bec446d90802694e393a456bb209cd8aa
parentd7b76c91f471413de9ded837bddeca2164786571 (diff)
downloadlinux-82e3b88b679049f043fe9b03991d6d66fc0a43c8.tar.gz
linux-82e3b88b679049f043fe9b03991d6d66fc0a43c8.tar.bz2
linux-82e3b88b679049f043fe9b03991d6d66fc0a43c8.zip
[media] cx24117: fix a buffer overflow when checking userspace params
The maximum size for a DiSEqC command is 6, according to the userspace API. However, the code allows to write up much more values: drivers/media/dvb-frontends/cx24116.c:983 cx24116_send_diseqc_msg() error: buffer overflow 'd->msg' 6 <= 23 Cc: stable@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r--drivers/media/dvb-frontends/cx24117.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/dvb-frontends/cx24117.c b/drivers/media/dvb-frontends/cx24117.c
index acb965ce0358..af6363573efd 100644
--- a/drivers/media/dvb-frontends/cx24117.c
+++ b/drivers/media/dvb-frontends/cx24117.c
@@ -1043,7 +1043,7 @@ static int cx24117_send_diseqc_msg(struct dvb_frontend *fe,
dev_dbg(&state->priv->i2c->dev, ")\n");
/* Validate length */
- if (d->msg_len > 15)
+ if (d->msg_len > sizeof(d->msg))
return -EINVAL;
/* DiSEqC message */