[media] cx22700: Fix potential buffer overflow
As new FEC types were added, we need a check to avoid overflows: drivers/media/dvb-frontends/cx22700.c:172 cx22700_set_tps() error: buffer overflow 'fec_tab' 6 <= 6 drivers/media/dvb-frontends/cx22700.c:173 cx22700_set_tps() error: buffer overflow 'fec_tab' 6 <= 6 Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
Родитель
b9f62ffe05
Коммит
667c952e71
|
@ -169,6 +169,9 @@ static int cx22700_set_tps(struct cx22700_state *state,
|
||||||
|
|
||||||
cx22700_writereg (state, 0x04, val);
|
cx22700_writereg (state, 0x04, val);
|
||||||
|
|
||||||
|
if (p->code_rate_HP - FEC_1_2 >= sizeof(fec_tab) ||
|
||||||
|
p->code_rate_LP - FEC_1_2 >= sizeof(fec_tab))
|
||||||
|
return -EINVAL;
|
||||||
val = fec_tab[p->code_rate_HP - FEC_1_2] << 3;
|
val = fec_tab[p->code_rate_HP - FEC_1_2] << 3;
|
||||||
val |= fec_tab[p->code_rate_LP - FEC_1_2];
|
val |= fec_tab[p->code_rate_LP - FEC_1_2];
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче