From 9735be5ef3ee25ce22e1ec948e3fa444e098f635 Mon Sep 17 00:00:00 2001 From: Przemek Stekiel Date: Tue, 4 Apr 2023 09:07:10 +0200 Subject: [PATCH] Fix memory allocations in pkcs7_verify test Signed-off-by: Przemek Stekiel --- tests/suites/test_suite_pkcs7.function | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/suites/test_suite_pkcs7.function b/tests/suites/test_suite_pkcs7.function index 016714ba6..3c93d0fcf 100644 --- a/tests/suites/test_suite_pkcs7.function +++ b/tests/suites/test_suite_pkcs7.function @@ -84,8 +84,8 @@ void pkcs7_verify(char *pkcs7_file, } } - ASSERT_ALLOC(crts, sizeof(*crts)*n_crts); - ASSERT_ALLOC(crt_files_arr, sizeof(*crt_files_arr)*n_crts); + ASSERT_ALLOC(crts, n_crts); + ASSERT_ALLOC(crt_files_arr, n_crts); for (i = 0; i < strlen(crt_files); i++) { for (k = i; k < strlen(crt_files); k++) { @@ -101,7 +101,7 @@ void pkcs7_verify(char *pkcs7_file, mbedtls_pkcs7_init(&pkcs7); for (i = 0; i < n_crts; i++) { - ASSERT_ALLOC(crts[i], sizeof(*crts[i])); + ASSERT_ALLOC(crts[i], 1); mbedtls_x509_crt_init(crts[i]); }