google/grunt: Correctly extract OEM string from CBFS

In CBFS layout:
oem.bin size is 10 bytes.

In cbfs_boot_load_file, buffer size will need to be larger
than decompressed_size, otherwise CBFS data can not be
extracted into buffer.

Then we need to check buffer whether it's empty string separately.

BUG=b:79874904
BRANCH=master
TEST=emerge-grunt coreboot
Change-Id: I4f1bbb690ecca515ac920f5058ee19b5bfd8fa5e
Signed-off-by: Kevin Chiu <Kevin.Chiu@quantatw.com>
Reviewed-on: https://review.coreboot.org/28889
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
This commit is contained in:
Kevin Chiu 2018-10-03 10:12:44 +08:00 committed by Martin Roth
parent 59e923d757
commit 0fa007be13
1 changed files with 1 additions and 1 deletions

View File

@ -79,7 +79,7 @@ void board_bh720(struct device *dev)
const char *smbios_mainboard_manufacturer(void) const char *smbios_mainboard_manufacturer(void)
{ {
static char oem_bin_data[10]; static char oem_bin_data[11];
static const char *manuf; static const char *manuf;
if (!IS_ENABLED(CONFIG_USE_OEM_BIN)) if (!IS_ENABLED(CONFIG_USE_OEM_BIN))