Browse Source

[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>
tags/v0.9.4
Michael Brown 16 years ago
parent
commit
031b30898a
1 changed files with 2 additions and 4 deletions
  1. 2
    4
      src/arch/i386/firmware/pcbios/smbios.c

+ 2
- 4
src/arch/i386/firmware/pcbios/smbios.c View File

275
 		 * smbios_strings struct is constructed so as to
275
 		 * smbios_strings struct is constructed so as to
276
 		 * always end on a string boundary.
276
 		 * always end on a string boundary.
277
 		 */
277
 		 */
278
-		string_len = strlen_user ( smbios.address,
279
-					   ( structure->offset + offset ) );
278
+		string_len = strlen_user ( smbios.address, offset );
280
 		if ( --index == 0 ) {
279
 		if ( --index == 0 ) {
281
 			/* Copy string, truncating as necessary. */
280
 			/* Copy string, truncating as necessary. */
282
 			if ( len > string_len )
281
 			if ( len > string_len )
283
 				len = string_len;
282
 				len = string_len;
284
-			copy_from_user ( data, smbios.address,
285
-					 ( structure->offset + offset ), len );
283
+			copy_from_user ( data, smbios.address, offset, len );
286
 			return string_len;
284
 			return string_len;
287
 		}
285
 		}
288
 	}
286
 	}

Loading…
Cancel
Save