diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2014-09-09 12:05:28 (GMT) |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-09-23 19:13:38 (GMT) |
commit | cf3b576d52c1f0a204f0c8bdecc22a338f7ca5a4 (patch) | |
tree | c6332ee4913d4912a434d1bc39b6ac15ac08a0e0 /drivers/media/dvb-frontends/si21xx.c | |
parent | e947d9ad8ab118d51ff07b7d93c3c1a3e9f7c42f (diff) | |
download | linux-cf3b576d52c1f0a204f0c8bdecc22a338f7ca5a4.tar.xz |
[media] dvb: si21xx: buffer overflow in si21_writeregs()
"len" is user controlled and can be up to 255. Anything more than 59
will cause a buffer overflow so we need to add a test for that.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/dvb-frontends/si21xx.c')
-rw-r--r-- | drivers/media/dvb-frontends/si21xx.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/dvb-frontends/si21xx.c b/drivers/media/dvb-frontends/si21xx.c index 73b47cc..16850e2 100644 --- a/drivers/media/dvb-frontends/si21xx.c +++ b/drivers/media/dvb-frontends/si21xx.c @@ -236,6 +236,9 @@ static int si21_writeregs(struct si21xx_state *state, u8 reg1, .len = len + 1 }; + if (len > sizeof(buf) - 1) + return -EINVAL; + msg.buf[0] = reg1; memcpy(msg.buf + 1, data, len); |