From 74852038ee3dbf98a426df86a0a08da0f4397b35 Mon Sep 17 00:00:00 2001 From: Agathiyan Bragadeesh Date: Fri, 14 Jul 2023 15:56:33 +0100 Subject: [PATCH] Fix IAR trying to use memset_s in platform_util Signed-off-by: Agathiyan Bragadeesh --- library/platform_util.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/platform_util.c b/library/platform_util.c index e903f8ed32..608aac2132 100644 --- a/library/platform_util.c +++ b/library/platform_util.c @@ -97,7 +97,8 @@ * mbedtls_platform_zeroize() to use a suitable implementation for their * platform and needs. */ -#if !defined(MBEDTLS_PLATFORM_HAS_EXPLICIT_BZERO) && !defined(__STDC_LIB_EXT1__) \ +#if !defined(MBEDTLS_PLATFORM_HAS_EXPLICIT_BZERO) && !(defined(__STDC_LIB_EXT1__) && \ + !defined(__IAR_SYSTEMS_ICC__)) \ && !defined(_WIN32) static void *(*const volatile memset_func)(void *, int, size_t) = memset; #endif @@ -118,7 +119,7 @@ void mbedtls_platform_zeroize(void *buf, size_t len) */ __msan_unpoison(buf, len); #endif -#elif defined(__STDC_LIB_EXT1__) +#elif defined(__STDC_LIB_EXT1__) && !defined(__IAR_SYSTEMS_ICC__) memset_s(buf, len, 0, len); #elif defined(_WIN32) SecureZeroMemory(buf, len);