From 88846762cf2c58fe8321d9aee6544aa8b5887f7b Mon Sep 17 00:00:00 2001 From: Marcel Dancak Date: Tue, 2 Aug 2022 21:57:40 +0200 Subject: [PATCH] possible fix of invalid memory address dereference (#74 and #48) --- client.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client.go b/client.go index 862a138..7634315 100644 --- a/client.go +++ b/client.go @@ -207,10 +207,10 @@ func (c *client) readResponse(ctx context.Context, resp *ResponsePipe, req *Requ done := make(chan int) // readloop in goroutine - go func() { + go func(rwc io.ReadWriteCloser) { readLoop: for { - if err := rec.read(c.conn.rwc); err != nil { + if err := rec.read(rwc); err != nil { break } @@ -228,7 +228,7 @@ func (c *client) readResponse(ctx context.Context, resp *ResponsePipe, req *Requ } } close(done) - }() + }(c.conn.rwc) select { case <-ctx.Done():