aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/interface/smbios/smbios_settings.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/interface/smbios/smbios_settings.c b/src/interface/smbios/smbios_settings.c
index ca3f2fe2f..095c35d37 100644
--- a/src/interface/smbios/smbios_settings.c
+++ b/src/interface/smbios/smbios_settings.c
@@ -117,8 +117,16 @@ static int smbios_fetch ( struct settings *settings __unused,
* <offset> contains a string index. An <offset> of
* zero indicates that the <length> contains a literal
* string index.
+ *
+ * Since the byte at offset zero can never contain a
+ * string index, and a literal string index can never
+ * be zero, the combination of both <length> and
+ * <offset> being zero indicates that the entire
+ * structure is to be read.
*/
- if ( ( tag_len == 0 ) || ( tag_offset == 0 ) ) {
+ if ( ( tag_len == 0 ) && ( tag_offset == 0 ) ) {
+ tag_len = sizeof ( buf );
+ } else if ( ( tag_len == 0 ) || ( tag_offset == 0 ) ) {
index = ( ( tag_offset == 0 ) ?
tag_len : buf[tag_offset] );
if ( ( rc = read_smbios_string ( &structure, index,