aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brown <mcb30@etherboot.org>2008-06-11 13:43:58 +0100
committerMichael Brown <mcb30@etherboot.org>2008-06-11 13:43:58 +0100
commit031b30898a098d7bb2d2d14a7639ed060274528a (patch)
treeccaca32668d2edc129951221746bd3592f9cdc20
parentc3811d4a1339c29254db1ce04810259448840bcc (diff)
downloadipxe-031b30898a098d7bb2d2d14a7639ed060274528a.tar.gz
[smbios] Fix SMBIOS string fetching
A bug in read_smbios_string() was causing the starting offset of the SMBIOS structure to be added twice, resulting in completely the wrong strings being returned. Bug identified by Martin Herweg <m.herweg@gmx.de>
-rw-r--r--src/arch/i386/firmware/pcbios/smbios.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/arch/i386/firmware/pcbios/smbios.c b/src/arch/i386/firmware/pcbios/smbios.c
index aa4f3f329..875d421b4 100644
--- a/src/arch/i386/firmware/pcbios/smbios.c
+++ b/src/arch/i386/firmware/pcbios/smbios.c
@@ -275,14 +275,12 @@ int read_smbios_string ( struct smbios_structure *structure,
* smbios_strings struct is constructed so as to
* always end on a string boundary.
*/
- string_len = strlen_user ( smbios.address,
- ( structure->offset + offset ) );
+ string_len = strlen_user ( smbios.address, offset );
if ( --index == 0 ) {
/* Copy string, truncating as necessary. */
if ( len > string_len )
len = string_len;
- copy_from_user ( data, smbios.address,
- ( structure->offset + offset ), len );
+ copy_from_user ( data, smbios.address, offset, len );
return string_len;
}
}