aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFred Reitberger <reitbergerfred@gmail.com>2023-02-08 16:05:08 -0500
committerFelix Held <felix-coreboot@felixheld.de>2023-02-10 15:52:40 +0000
commitf9eeded219d7e75154989d11ec1c70445523fada (patch)
tree2fa5e81dd9061c39f3ad7d2821985b23850b09e0 /src
parent84aa9a74e8aa70167ad5ee82e06a435d731c573a (diff)
drivers/fsp2: Don't print garbage if the FSP signature doesn't match
Using a &uint64_t as a string argument does not include the required NULL character termination. Update the format string to only print the 8 desired characters and not continue printing stack memory until a NULL is found. Before: [EMERG] Invalid UPD signature! FSP provided "AMD_01_M;....`", expected was "CEZANE_MAMD_01_M;....`". After: [EMERG] Invalid UPD signature! FSP provided "AMD_01_M", expected was "CEZANE_M". Signed-off-by: Fred Reitberger <reitbergerfred@gmail.com> Change-Id: Ib334daa8518a92e0cf3d22c4d95908f4c84afe04 Reviewed-on: https://review.coreboot.org/c/coreboot/+/72911 Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src')
-rw-r--r--src/drivers/intel/fsp2_0/util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/drivers/intel/fsp2_0/util.c b/src/drivers/intel/fsp2_0/util.c
index 1dedb6587f..7fa2af4722 100644
--- a/src/drivers/intel/fsp2_0/util.c
+++ b/src/drivers/intel/fsp2_0/util.c
@@ -183,7 +183,7 @@ void fsp_verify_upd_header_signature(uint64_t upd_signature, uint64_t expected_s
/* The UPD signatures are non-zero-terminated ASCII stored as a little endian
uint64_t, so this needs some casts. */
die_with_post_code(POST_INVALID_VENDOR_BINARY,
- "Invalid UPD signature! FSP provided \"%8s\", expected was \"%8s\".\n",
+ "Invalid UPD signature! FSP provided \"%.8s\", expected was \"%.8s\".\n",
(char *)&upd_signature,
(char *)&expected_signature);
}