Commit 14b57418 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab Committed by Luis Henriques

[media] cx24117: fix a buffer overflow when checking userspace params

commit 82e3b88b upstream.

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
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 8f0a1a87
...@@ -1043,7 +1043,7 @@ static int cx24117_send_diseqc_msg(struct dvb_frontend *fe, ...@@ -1043,7 +1043,7 @@ static int cx24117_send_diseqc_msg(struct dvb_frontend *fe,
dev_dbg(&state->priv->i2c->dev, ")\n"); dev_dbg(&state->priv->i2c->dev, ")\n");
/* Validate length */ /* Validate length */
if (d->msg_len > 15) if (d->msg_len > sizeof(d->msg))
return -EINVAL; return -EINVAL;
/* DiSEqC message */ /* DiSEqC message */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment