mirror of
https://github.com/yuzu-emu/mbedtls
synced 2024-11-24 01:14:02 +00:00
Check for zero length and NULL buffer pointer
In reference to issue https://github.com/ARMmbed/mbed-crypto/issues/49
This commit is contained in:
parent
376d0d9e4a
commit
0c34499805
1 changed files with 4 additions and 1 deletions
|
@ -72,7 +72,10 @@ static void * (* const volatile memset_func)( void *, int, size_t ) = memset;
|
||||||
|
|
||||||
void mbedtls_platform_zeroize( void *buf, size_t len )
|
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 */
|
#endif /* MBEDTLS_PLATFORM_ZEROIZE_ALT */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue