From 5025fe2fa0683444b45dffa16fac98be162cf075 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Tue, 23 Aug 2022 19:07:31 +0300 Subject: [PATCH] fix: Protect circular buffer during close in reconnectingPTY (#3646) --- agent/agent.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/agent/agent.go b/agent/agent.go index 586a1785e8..146cc936cd 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -801,7 +801,9 @@ func (r *reconnectingPTY) Close() { _ = conn.Close() } _ = r.ptty.Close() + r.circularBufferMutex.Lock() r.circularBuffer.Reset() + r.circularBufferMutex.Unlock() r.timeout.Stop() }