diff options
author | Jean Delvare <jdelvare@suse.de> | 2015-06-29 11:06:14 +0000 |
---|---|---|
committer | Jean Delvare <jdelvare@suse.de> | 2015-06-29 11:06:14 +0000 |
commit | 3bbb93ea8224e81023db8b6ef2358f736adfab45 (patch) | |
tree | 2e921cf90f73257f57302bb93d2b0e4dc98b8686 | |
parent | 31d3bbdcb8f9d14534e54650dc0dab214a368a32 (diff) | |
download | i2c-tools-3bbb93ea8224e81023db8b6ef2358f736adfab45.tar.gz |
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
-rw-r--r-- | CHANGES | 1 | ||||
-rwxr-xr-x | eeprom/decode-dimms | 2 |
2 files changed, 2 insertions, 1 deletions
@@ -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; |