From 5e09bc7eb5293578f2a400dcfce221f6321a74de Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Fri, 21 Dec 2018 12:06:15 +0100 Subject: [PATCH] Fix maybe-uninitialized warning GCC 4.8 warns that some variables may be used without having been initialized. They aren't, but determining that takes nontrivial analysis, so initialize them at the point of definition. --- programs/psa/key_ladder_demo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/programs/psa/key_ladder_demo.c b/programs/psa/key_ladder_demo.c index 470b1fce4..4acf6b150 100644 --- a/programs/psa/key_ladder_demo.c +++ b/programs/psa/key_ladder_demo.c @@ -393,7 +393,7 @@ static psa_status_t wrap_data( const char *input_file_name, FILE *output_file = NULL; long input_position; size_t input_size; - size_t buffer_size; + size_t buffer_size = 0; unsigned char *buffer = NULL; size_t ciphertext_size; wrapped_data_header_t header; @@ -469,7 +469,7 @@ static psa_status_t unwrap_data( const char *input_file_name, FILE *input_file = NULL; FILE *output_file = NULL; unsigned char *buffer = NULL; - size_t ciphertext_size; + size_t ciphertext_size = 0; size_t plaintext_size; wrapped_data_header_t header; unsigned char extra_byte;