diff options
author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-11-05 09:34:12 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-11-05 09:34:12 -0200 |
commit | b9f62ffe05e4019da205d6fec244226b191c5242 (patch) | |
tree | 5dfe4fabb1b86c4248a930407970b02e234233f9 /drivers | |
parent | fb9b1641ba30385e1c142ecef2b631d31a881fd1 (diff) |
[media] stb0899: don't go past DiSEqC msg buffer
As reported by spatch:
drivers/media/dvb-frontends/stb0899_drv.c:720 stb0899_send_diseqc_msg() error: buffer overflow 'cmd->msg' 6 <= 7
The buffer size is 6 and not 8. Anyway, the best is to use sizeof(),
to avoid such mistakes.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/dvb-frontends/stb0899_drv.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/dvb-frontends/stb0899_drv.c b/drivers/media/dvb-frontends/stb0899_drv.c index 07cd5ea7a03..19646fbb061 100644 --- a/drivers/media/dvb-frontends/stb0899_drv.c +++ b/drivers/media/dvb-frontends/stb0899_drv.c @@ -705,7 +705,7 @@ static int stb0899_send_diseqc_msg(struct dvb_frontend *fe, struct dvb_diseqc_ma struct stb0899_state *state = fe->demodulator_priv; u8 reg, i; - if (cmd->msg_len > 8) + if (cmd->msg_len > sizeof(cmd->msg)) return -EINVAL; /* enable FIFO precharge */ |