diff options
author | khali <khali@7894878c-1315-0410-8ee3-d5d059ff63e0> | 2015-06-29 11:06:14 +0000 |
---|---|---|
committer | khali <khali@7894878c-1315-0410-8ee3-d5d059ff63e0> | 2015-06-29 11:06:14 +0000 |
commit | 77d73b84a931b8a2b8e6dd07a977b4a003f7fcaf (patch) | |
tree | 2e921cf90f73257f57302bb93d2b0e4dc98b8686 | |
parent | 925f991df2b0ad2bc205bc71092b998cd5738045 (diff) | |
download | i2c-tools-77d73b84a931b8a2b8e6dd07a977b4a003f7fcaf.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; |