Skip to content

Commit

Permalink
Check for zero length and NULL buffer pointer.
Browse files Browse the repository at this point in the history
In reference to issue ARMmbed#49
  • Loading branch information
jainvikas8 committed Aug 15, 2019
1 parent 0ed1df6 commit 0fc1dfe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/platform_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ 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 );
if ( buf != NULL && len > 0 )
memset_func( buf, 0, len );
}
#endif /* MBEDTLS_PLATFORM_ZEROIZE_ALT */

Expand Down

0 comments on commit 0fc1dfe

Please sign in to comment.