[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>
This commit is contained in:
Mauro Carvalho Chehab 2014-11-05 09:34:12 -02:00
parent fb9b1641ba
commit b9f62ffe05
1 changed files with 1 additions and 1 deletions

View File

@ -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 */