From 3e9cc2c213656198600b7a6113dc418de8ce7297 Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Tue, 22 Oct 2024 15:39:33 +0200 Subject: [PATCH] key_ladder_demo: Initialize additional data to all zeroes The header structure was initialized only field by field. This does not initialized the padding bytes and MemSan was complaining with use of uninitialized data in test_memsan all.sh component. Signed-off-by: Ronald Cron --- programs/psa/key_ladder_demo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/programs/psa/key_ladder_demo.c b/programs/psa/key_ladder_demo.c index 2734ceb7f..0ea434fc5 100644 --- a/programs/psa/key_ladder_demo.c +++ b/programs/psa/key_ladder_demo.c @@ -392,6 +392,7 @@ static psa_status_t wrap_data(const char *input_file_name, input_file = NULL; /* Construct a header. */ + memset(&header, 0, sizeof(header)); memcpy(&header.magic, WRAPPED_DATA_MAGIC, WRAPPED_DATA_MAGIC_LENGTH); header.ad_size = sizeof(header); header.payload_size = input_size;