mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-28 08:37:25 +00:00
Merge pull request #6521 from daverodgman/fix_ssl_zeroize
Fix zeroization at NULL pointer
This commit is contained in:
commit
5f8dfb5393
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.
|
@ -5635,7 +5635,9 @@ static int tls_prf_generic( mbedtls_md_type_t md_type,
|
|||||||
exit:
|
exit:
|
||||||
mbedtls_md_free( &md_ctx );
|
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_platform_zeroize( h_i, sizeof( h_i ) );
|
||||||
|
|
||||||
mbedtls_free( tmp );
|
mbedtls_free( tmp );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user