Aladyshev Konstantin has uploaded this change for review.

View Change

SMBIOS: Correct length calculation for empty string table

If all strings in SMBIOS table are empty, smbios_string_table_len
function should return 2, cause every table must end with "\0\0".

Change-Id: Ia3178b0030aa71e1ff11a3fd3d102942f0027eb1
Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
---
M src/arch/x86/smbios.c
1 file changed, 4 insertions(+), 0 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/40/20840/1
diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c
index 72fb0df..8e95ea6 100644
--- a/src/arch/x86/smbios.c
+++ b/src/arch/x86/smbios.c
@@ -81,6 +81,10 @@
p += i;
len += i;
}
+
+ if (!len)
+ return 2;
+
return len + 1;
}

To view, visit change 20840. To unsubscribe, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia3178b0030aa71e1ff11a3fd3d102942f0027eb1
Gerrit-Change-Number: 20840
Gerrit-PatchSet: 1
Gerrit-Owner: Aladyshev Konstantin <aladyshev22@gmail.com>