mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-23 14:15:37 +00:00
Zeroize return buf on failure in platform.c
This commit is contained in:
parent
13f41e1c20
commit
79a2e7ef06
|
@ -228,12 +228,13 @@ int mbedtls_platform_std_nv_seed_read( unsigned char *buf, size_t buf_len )
|
||||||
size_t n;
|
size_t n;
|
||||||
|
|
||||||
if( ( file = fopen( MBEDTLS_PLATFORM_STD_NV_SEED_FILE, "rb" ) ) == NULL )
|
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 )
|
if( ( n = fread( buf, 1, buf_len, file ) ) != buf_len )
|
||||||
{
|
{
|
||||||
fclose( file );
|
fclose( file );
|
||||||
return -1;
|
mbedtls_zeroize( buf, buf_len );
|
||||||
|
return( -1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose( file );
|
fclose( file );
|
||||||
|
|
Loading…
Reference in a new issue