From 594a330eb7c344a54407956f3175ea97ee6f973b Mon Sep 17 00:00:00 2001 From: Jaeden Amero Date: Fri, 26 Oct 2018 17:07:22 +0100 Subject: [PATCH] psa: test: Fix truncation of message by snprintf We had only allocated 40 bytes for printing into, but we wanted to print 46 bytes. Update the buffer to be 47 bytes, which is large enough to hold what we want to print plus a terminating null byte. --- tests/suites/test_suite_psa_crypto.function | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/suites/test_suite_psa_crypto.function b/tests/suites/test_suite_psa_crypto.function index 14caa9ddf..d2875ae34 100644 --- a/tests/suites/test_suite_psa_crypto.function +++ b/tests/suites/test_suite_psa_crypto.function @@ -631,7 +631,7 @@ static int exported_key_sanity_check( psa_key_type_t type, size_t bits, else #endif /* MBEDTLS_ECP_C */ { - char message[40]; + char message[47]; mbedtls_snprintf( message, sizeof( message ), "No sanity check for public key type=0x%08lx", (unsigned long) type );