]> git.baikalelectronics.ru Git - kernel.git/commit
[media] ivtv: avoid going past input/audio array
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 28 Apr 2015 13:35:13 +0000 (10:35 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Thu, 30 Apr 2015 16:36:15 +0000 (13:36 -0300)
commitc75b99bb455a3e91cd0c64e5bbc0df97eb88405f
tree093b749c6979576f9f38e67da7c71e7944e834da
parent34f541a424c2bef77dd5f256fac7b9dbae88bcdd
[media] ivtv: avoid going past input/audio array

As reported by smatch:
drivers/media/pci/ivtv/ivtv-driver.c:832 ivtv_init_struct2() error: buffer overflow 'itv->card->video_inputs' 6 <= 6

That happens because nof_inputs and nof_audio_inputs can be initialized
as IVTV_CARD_MAX_VIDEO_INPUTS, instead of IVTV_CARD_MAX_VIDEO_INPUTS - 1.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/pci/ivtv/ivtv-driver.c