mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-06-03 23:58:17 +00:00
Zeroize return buf on failure in pkparse.c
This commit is contained in:
parent
f113161192
commit
e7c839bf02
|
@ -101,7 +101,10 @@ int mbedtls_pk_load_file( const char *path, unsigned char **buf, size_t *n )
|
||||||
if( fread( *buf, 1, *n, f ) != *n )
|
if( fread( *buf, 1, *n, f ) != *n )
|
||||||
{
|
{
|
||||||
fclose( f );
|
fclose( f );
|
||||||
|
|
||||||
|
mbedtls_zeroize( *buf, *n );
|
||||||
mbedtls_free( *buf );
|
mbedtls_free( *buf );
|
||||||
|
|
||||||
return( MBEDTLS_ERR_PK_FILE_IO_ERROR );
|
return( MBEDTLS_ERR_PK_FILE_IO_ERROR );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue