From 3bbb93ea8224e81023db8b6ef2358f736adfab45 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Mon, 29 Jun 2015 11:06:14 +0000 Subject: [PATCH] decode-dimms: Correctly check for out-of-bounds vendor ID Contributed by Lubomir Rintel. git-svn-id: http://lm-sensors.org/svn/i2c-tools/trunk@6295 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CHANGES | 1 + eeprom/decode-dimms | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 1fe5d71..92083eb 100644 --- a/CHANGES +++ b/CHANGES @@ -41,6 +41,7 @@ SVN HEAD Encode "degrees" to HTML degree symbol Generate XHTML 1.1 compliant markup Add a manual page + Correctly check for out-of-bounds vendor ID decode-vaio: Add a manual page eeprog: Add a manual page eeprom: Add a manual page diff --git a/eeprom/decode-dimms b/eeprom/decode-dimms index ca2e29f..2eb1975 100755 --- a/eeprom/decode-dimms +++ b/eeprom/decode-dimms @@ -345,7 +345,7 @@ sub manufacturer_ddr3($$) my $manufacturer; return "Invalid" if parity($code) != 1; - return "Unknown" if ($code & 0x7F) - 1 > $vendors[$count & 0x7F]; + return "Unknown" if ($code & 0x7F) - 1 >= @{$vendors[$count & 0x7F]}; $manufacturer = $vendors[$count & 0x7F][($code & 0x7F) - 1]; $manufacturer =~ s/ \(former .*\)$// if $opt_side_by_side; $manufacturer .= "? (Invalid parity)" if parity($count) != 1;