mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-03-31 17:51:11 +02:00
Merge pull request #6523 from daverodgman/fix_ssl_zeroize-2.28
Fix zeroization at NULL pointer - 2.28 backport
This commit is contained in:
3
ChangeLog.d/fix_zeroization.txt
Normal file
3
ChangeLog.d/fix_zeroization.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
Bugfix
|
||||
* Fix possible crash in TLS PRF code, if a failure to allocate memory occurs.
|
||||
Reported by Michael Madsen in #6516.
|
||||
@@ -760,7 +760,9 @@ static int tls_prf_generic( mbedtls_md_type_t md_type,
|
||||
exit:
|
||||
mbedtls_md_free( &md_ctx );
|
||||
|
||||
mbedtls_platform_zeroize( tmp, tmp_len );
|
||||
if ( tmp != NULL )
|
||||
mbedtls_platform_zeroize( tmp, tmp_len );
|
||||
|
||||
mbedtls_platform_zeroize( h_i, sizeof( h_i ) );
|
||||
|
||||
mbedtls_free( tmp );
|
||||
|
||||
Reference in New Issue
Block a user