[SLOF] [PATCH 2/3] tcgbios: Fix the vendorInfoSize to be of type uint8_t

Stefan Berger stefanb at linux.vnet.ibm.com
Sun Mar 29 06:38:58 AEDT 2020


From: Stefan Berger <stefanb at linux.ibm.com>

The vendorInfoSize is a uint8_t rather than a uint32_t.

Signed-off-by: Stefan Berger <stefanb at linux.ibm.com>
---
 lib/libtpm/tcgbios.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/libtpm/tcgbios.c b/lib/libtpm/tcgbios.c
index aa0ef5a..743f66a 100644
--- a/lib/libtpm/tcgbios.c
+++ b/lib/libtpm/tcgbios.c
@@ -647,7 +647,7 @@ static int tpm20_write_EfiSpecIdEventStruct(void)
 	struct tpms_pcr_selection *sel;
 	void *nsel, *end;
 	int event_size;
-	uint32_t *vendorInfoSize;
+	uint8_t *vendorInfoSize;
 	struct tpm_log_entry le = {
 		.hdr.eventtype = cpu_to_log32(EV_NO_ACTION),
 	};
@@ -682,7 +682,7 @@ static int tpm20_write_EfiSpecIdEventStruct(void)
 
 		event_size = offset_of(struct TCG_EfiSpecIdEventStruct,
 				       digestSizes[count+1]);
-		if (event_size > sizeof(event) - sizeof(uint32_t)) {
+		if (event_size > sizeof(event) - sizeof(uint8_t)) {
 			dprintf("EfiSpecIdEventStruct pad too small\n");
 			return -1;
 		}
-- 
2.24.1



More information about the SLOF mailing list