mirror of
https://github.com/espressif/mbedtls.git
synced 2026-10-07 17:47:23 +00: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:
@@ -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.
|
||||
+3
-1
@@ -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