Fix heap use-after-free corruption issue
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
This commit is contained in:
parent
307a7303fd
commit
997669aeeb
1 changed files with 5 additions and 2 deletions
|
@ -258,9 +258,12 @@ int mbedtls_ssl_session_copy( mbedtls_ssl_session *dst,
|
|||
defined(MBEDTLS_SSL_SERVER_NAME_INDICATION)
|
||||
if( src->endpoint == MBEDTLS_SSL_IS_CLIENT )
|
||||
{
|
||||
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
|
||||
dst->hostname = NULL;
|
||||
return mbedtls_ssl_session_set_hostname( dst,
|
||||
ret = mbedtls_ssl_session_set_hostname( dst,
|
||||
src->hostname );
|
||||
if( ret != 0)
|
||||
return ret;
|
||||
}
|
||||
#endif /* MBEDTLS_SSL_PROTO_TLS1_3 && MBEDTLS_SSL_SERVER_NAME_INDICATION */
|
||||
#endif /* MBEDTLS_SSL_SESSION_TICKETS && MBEDTLS_SSL_CLI_C */
|
||||
|
|
Loading…
Reference in a new issue