From 5cf6f7eafe7a22af2481b973c2b69c317522d618 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Fri, 14 May 2021 14:45:04 +0100 Subject: [PATCH] Fix swapping of first and last entry in SSL session cache Signed-off-by: Hanno Becker --- library/ssl_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/ssl_cache.c b/library/ssl_cache.c index f33754798..11afd8624 100644 --- a/library/ssl_cache.c +++ b/library/ssl_cache.c @@ -225,7 +225,7 @@ static int ssl_cache_pick_writing_slot( mbedtls_ssl_cache_context *cache, old = cache->chain; cache->chain = old->next; - cur->next = NULL; + old->next = NULL; prv->next = old; #endif /* MBEDTLS_HAVE_TIME */