From ac72f9c213b597451d4cf1acc89b8d4792fa0266 Mon Sep 17 00:00:00 2001 From: Thomas Daubney Date: Wed, 2 Mar 2022 16:44:51 +0000 Subject: [PATCH] Initialise iv buffer before use Commit initialises the iv buffer before it ias passed to mbedtls_cipher_set_iv(). Signed-off-by: Thomas Daubney --- tests/suites/test_suite_cipher.function | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/suites/test_suite_cipher.function b/tests/suites/test_suite_cipher.function index 03c17331a..e23403551 100644 --- a/tests/suites/test_suite_cipher.function +++ b/tests/suites/test_suite_cipher.function @@ -1605,6 +1605,9 @@ void check_iv( int cipher_id, char * cipher_string, size_t iv_len = iv_len_val; unsigned char iv[16]; + /* Initialise iv buffer */ + memset( iv, 0, sizeof( iv ) ); + const mbedtls_cipher_info_t *cipher_info; mbedtls_cipher_context_t ctx_dec; mbedtls_cipher_context_t ctx_enc;