lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1394818171-13052-1-git-send-email-colin.king@canonical.com>
Date:	Fri, 14 Mar 2014 17:29:31 +0000
From:	Colin King <colin.king@...onical.com>
To:	Mauro Carvalho Chehab <m.chehab@...sung.com>,
	linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] ds3000: fix array out of bounds access

From: Colin Ian King <colin.king@...onical.com>

cppcheck reports an array out of bounds access:

[drivers/media/dvb-frontends/ds3000.c:619]: (error) Array
 'dvbs2_snr_tab[80]' accessed at index 80, which is out of bounds.

the index check is off by one, so fix this to avoid the error.

Signed-off-by: Colin Ian King <colin.king@...onical.com>
---
 drivers/media/dvb-frontends/ds3000.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/dvb-frontends/ds3000.c b/drivers/media/dvb-frontends/ds3000.c
index 1e344b0..d2bda93 100644
--- a/drivers/media/dvb-frontends/ds3000.c
+++ b/drivers/media/dvb-frontends/ds3000.c
@@ -614,8 +614,8 @@ static int ds3000_read_snr(struct dvb_frontend *fe, u16 *snr)
 			*snr = snr_value * 5 * 655;
 		} else {
 			snr_reading = dvbs2_noise_reading / tmp;
-			if (snr_reading > 80)
-				snr_reading = 80;
+			if (snr_reading > 79)
+				snr_reading = 79;
 			*snr = -(dvbs2_snr_tab[snr_reading] / 1000);
 		}
 		dprintk("%s: raw / cooked = 0x%02x / 0x%04x\n", __func__,
-- 
1.9.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ