commit | 79a2e7ef069d6420070562e2fd8a9802fa3aa6ff | [log] [tgz] |
---|---|---|
author | Andres Amaya Garcia <andres.amayagarcia@arm.com> | Mon Jun 26 11:10:22 2017 +0100 |
committer | Andres Amaya Garcia <andres.amayagarcia@arm.com> | Mon Jun 26 11:10:22 2017 +0100 |
tree | 0625f9985e010f10519baa824915d5ad857cf3c2 | |
parent | 13f41e1c20a4a2ed81af332a4be32bd8265fc073 [diff] [blame] |
Zeroize return buf on failure in platform.c
diff --git a/library/platform.c b/library/platform.c index 8b336c3..441298b 100644 --- a/library/platform.c +++ b/library/platform.c
@@ -228,12 +228,13 @@ 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 );