From f255bcb9ec4d2d0b436bf02f36364110ab1bbc32 Mon Sep 17 00:00:00 2001 From: own2pwn <7850039+own2pwn@users.noreply.github.com> Date: Mon, 28 Aug 2023 21:21:05 +0300 Subject: [PATCH] Fix removing session state (#236) Probably we should check that state is nil rather than the map? --- examples/tls-resumption/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/tls-resumption/main.go b/examples/tls-resumption/main.go index 82b8f5c8..ea98c4a7 100644 --- a/examples/tls-resumption/main.go +++ b/examples/tls-resumption/main.go @@ -29,7 +29,7 @@ func (csc *ClientSessionCache) Get(sessionKey string) (session *tls.ClientSessio } func (csc *ClientSessionCache) Put(sessionKey string, cs *tls.ClientSessionState) { - if csc.sessionKeyMap == nil { + if cs == nil { fmt.Printf("Deleting session for %s\n", sessionKey) delete(csc.sessionKeyMap, sessionKey) } else {