1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-01 10:06:53 +03:00

Add a workaround for max test suite parameter sizes

int isn't enough for SIZE_MAX/2.
Hardcoding the value will make the compilers complain.
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
This commit is contained in:
Andrzej Kurek
2023-07-14 15:16:35 -04:00
parent 3f87d63c71
commit 0841b5a178
2 changed files with 2 additions and 2 deletions

View File

@ -200,7 +200,7 @@ exit:
void check_mbedtls_calloc_overallocation(int num, int size)
{
unsigned char *buf;
buf = mbedtls_calloc((size_t) num, (size_t) size);
buf = mbedtls_calloc((size_t) num * SIZE_MAX/2, (size_t) size * SIZE_MAX/2);
/* Dummy usage of the pointer to prevent optimizing it */
mbedtls_printf("calloc pointer : %p\n", buf);
TEST_ASSERT(buf == NULL);