From 8b3efff19e95e235d867bb6d8f36b83833d50c1a Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Mon, 23 Sep 2024 16:39:08 -0400 Subject: [PATCH] tpm2: Add const qualifier to char array in StringToUint32 Only constant strings will be passed to StringToUint32 and therefore add the const qualifier. Signed-off-by: Stefan Berger --- src/tpm2/VendorInfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tpm2/VendorInfo.c b/src/tpm2/VendorInfo.c index f2139d57..5f416ac1 100644 --- a/src/tpm2/VendorInfo.c +++ b/src/tpm2/VendorInfo.c @@ -83,7 +83,7 @@ static uint32_t currentHash = FIRMWARE_V2; static uint16_t currentSvn = 10; // Similar to the Core Library's ByteArrayToUint32, but usable in Platform code. -static uint32_t StringToUint32(char s[4]) +static uint32_t StringToUint32(const char s[4]) // libtpms changed: added const { uint8_t* b = (uint8_t*)s; // Avoid promotion to a signed integer type return (((uint32_t)b[0] << 8 | b[1]) << 8 | b[2]) << 8 | b[3];