mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-04-07 21:07:20 +02:00
[session] fix a session copy bug
fix a possible double reference on 'ticket' when peer_cert/peer_cert_digest calloc failed. Signed-off-by: 吴敬辉 <11137405@vivo.com>
This commit is contained in:
@@ -301,6 +301,10 @@ static int ssl_session_copy( mbedtls_ssl_session *dst, const mbedtls_ssl_session
|
||||
mbedtls_ssl_session_free( dst );
|
||||
memcpy( dst, src, sizeof( mbedtls_ssl_session ) );
|
||||
|
||||
#if defined(MBEDTLS_SSL_SESSION_TICKETS) && defined(MBEDTLS_SSL_CLI_C)
|
||||
dst->ticket = NULL;
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_X509_CRT_PARSE_C)
|
||||
if( src->peer_cert != NULL )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user