From b94fdae3c387628cbc5b934bb33c76a926880e22 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Fri, 14 May 2021 04:42:43 +0100 Subject: [PATCH] Improve code structure for session cache query Signed-off-by: Hanno Becker --- library/ssl_srv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/ssl_srv.c b/library/ssl_srv.c index 213cd3ce66..5190367669 100644 --- a/library/ssl_srv.c +++ b/library/ssl_srv.c @@ -2801,9 +2801,9 @@ static void ssl_handle_id_based_session_resumption( mbedtls_ssl_context *ssl ) } /* Move semantics */ - /* Zeroization of session_tmp happens at the end of the function. */ mbedtls_ssl_session_free( session ); *session = session_tmp; + memset( &session_tmp, 0, sizeof( mbedtls_ssl_session ) ); MBEDTLS_SSL_DEBUG_MSG( 3, ( "session successfully restored from cache" ) ); ssl->handshake->resume = 1;