未验证 提交 4dbead96 编写于 作者: 毛宇锋 提交者: Gitee

[session] fix a session copy bug

fix a possible double reference on 'ticket'
when peer_cert/peer_cert_digest calloc failed.
Cherry-pick from https://github.com/Mbed-TLS/mbedtls/commit/eb490aabf6a9f47c074ec476d0d4997c2362cdbcSigned-off-by: Nmaoyufeng <maoyufeng3@huawei.com>
上级 72e02c0e
......@@ -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 )
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册