From cd4927465182a778721c6b3460b267e8aab89753 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Tue, 23 Aug 2022 18:56:21 +0300 Subject: [PATCH] fix: Protect circular buffer during close in reconnectingPTY --- agent/agent.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/agent/agent.go b/agent/agent.go index 586a1785e8515..146cc936cd179 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() }