mirror of
https://github.com/yuzu-emu/mbedtls
synced 2024-11-24 16:28:15 +00:00
Zeroize return buf on failure in platform.c
This commit is contained in:
parent
13f41e1c20
commit
79a2e7ef06
1 changed files with 3 additions and 2 deletions
|
@ -228,12 +228,13 @@ int mbedtls_platform_std_nv_seed_read( unsigned char *buf, size_t buf_len )
|
|||
size_t n;
|
||||
|
||||
if( ( file = fopen( MBEDTLS_PLATFORM_STD_NV_SEED_FILE, "rb" ) ) == NULL )
|
||||
return -1;
|
||||
return( -1 );
|
||||
|
||||
if( ( n = fread( buf, 1, buf_len, file ) ) != buf_len )
|
||||
{
|
||||
fclose( file );
|
||||
return -1;
|
||||
mbedtls_zeroize( buf, buf_len );
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
fclose( file );
|
||||
|
|
Loading…
Reference in a new issue