From 3d303cc0eac7d0e57557924964ea795da2fb4c3e Mon Sep 17 00:00:00 2001 From: Dimitrios Siganos Date: Sun, 9 Nov 2025 11:50:52 +0000 Subject: [PATCH 07/30] tpm2_checkquote: Fix missing error checking The return of malloc was not checked Signed-off-by: Dimitrios Siganos --- tools/misc/tpm2_checkquote.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/misc/tpm2_checkquote.c b/tools/misc/tpm2_checkquote.c index bdc54240..648a383f 100644 --- a/tools/misc/tpm2_checkquote.c +++ b/tools/misc/tpm2_checkquote.c @@ -398,6 +398,10 @@ static bool parse_marshaled_selection_data(FILE *pcr_input, UINT32 count; buffer = malloc(fsize); + if (!buffer) { + LOG_ERR("OOM"); + return false; + } if (!file_read_bytes_from_file(pcr_input, buffer, &size, ctx.pcr_file_path)) { LOG_ERR("Failed to read PCR selection from file"); -- 2.54.0