media: m88rs6000t: avoid potential out-of-bounds reads on arrays
authorColin Ian King <colin.king@canonical.com>
Wed, 7 Oct 2020 12:16:28 +0000 (14:16 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 May 2021 08:57:30 +0000 (10:57 +0200)
commit56b368301e128aeee1348451f6aff1271f25d566
tree5c24f7ef2112b5c3a061c6067ba92e89398d5e35
parentc66c51ba9bb6df6a22a0a9cba43830698abe5a17
media: m88rs6000t: avoid potential out-of-bounds reads on arrays

[ Upstream commit 9baa3d64e8e2373ddd11c346439e5dfccb2cbb0d ]

There a 3 array for-loops that don't check the upper bounds of the
index into arrays and this may lead to potential out-of-bounds
reads.  Fix this by adding array size upper bounds checks to be
full safe.

Addresses-Coverity: ("Out-of-bounds read")

Link: https://lore.kernel.org/linux-media/20201007121628.20676-1-colin.king@canonical.com
Fixes: 333829110f1d ("[media] m88rs6000t: add new dvb-s/s2 tuner for integrated chip M88RS6000")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/tuners/m88rs6000t.c