From 7d6ae2b72c0a4b521d2492fab606e1544f72e979 Mon Sep 17 00:00:00 2001 From: Maximilian Brune Date: Mon, 27 Mar 2023 04:04:29 +0200 Subject: [PATCH] arch/x86/smbios: Check str for NULL in smbios_add_string() Signed-off-by: Maximilian Brune Change-Id: Ic228b869aea362c1f07e0808c2735ff3b285a6bd Reviewed-on: https://review.coreboot.org/c/coreboot/+/73980 Reviewed-by: Eric Lai Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel --- src/arch/x86/smbios.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c index 188fb4256f..1ec0ad20fe 100644 --- a/src/arch/x86/smbios.c +++ b/src/arch/x86/smbios.c @@ -45,7 +45,7 @@ int smbios_add_string(u8 *start, const char *str) * Return 0 as required for empty strings. * See Section 6.1.3 "Text Strings" of the SMBIOS specification. */ - if (*str == '\0') + if (str == NULL || *str == '\0') return 0; for (;;) {