From d44d3eaa8d31dd22df24149c31e36715510577ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Fri, 14 Oct 2022 09:35:55 +0200 Subject: [PATCH] Fix usage of ASSERT_ALLOC() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The second argument is the number of elements of the type the first argument is pointing to, so we shouldn't be using sizeof there. This was resulting in overly large allocations. Signed-off-by: Manuel Pégourié-Gonnard --- tests/suites/test_suite_asn1parse.function | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/suites/test_suite_asn1parse.function b/tests/suites/test_suite_asn1parse.function index 6be2cfbbfc4e..4cc0f17e32f5 100644 --- a/tests/suites/test_suite_asn1parse.function +++ b/tests/suites/test_suite_asn1parse.function @@ -779,7 +779,7 @@ void free_named_data_list( int length ) for( i = 0; i < length; i++ ) { mbedtls_asn1_named_data *new = NULL; - ASSERT_ALLOC( new, sizeof( mbedtls_asn1_named_data ) ); + ASSERT_ALLOC( new, 1 ); new->next = head; head = new; }