summaryrefslogtreecommitdiff
path: root/thirdparty/mbedtls/library/platform_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'thirdparty/mbedtls/library/platform_util.c')
-rw-r--r--thirdparty/mbedtls/library/platform_util.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/thirdparty/mbedtls/library/platform_util.c b/thirdparty/mbedtls/library/platform_util.c
index 756e22679a..b1f745097c 100644
--- a/thirdparty/mbedtls/library/platform_util.c
+++ b/thirdparty/mbedtls/library/platform_util.c
@@ -72,7 +72,10 @@ static void * (* const volatile memset_func)( void *, int, size_t ) = memset;
void mbedtls_platform_zeroize( void *buf, size_t len )
{
- memset_func( buf, 0, len );
+ MBEDTLS_INTERNAL_VALIDATE( len == 0 || buf != NULL );
+
+ if( len > 0 )
+ memset_func( buf, 0, len );
}
#endif /* MBEDTLS_PLATFORM_ZEROIZE_ALT */