Skip to content

Commit

Permalink
possible fix of invalid memory address dereference (yookoala#74 and y…
Browse files Browse the repository at this point in the history
  • Loading branch information
marcel-dancak committed Aug 2, 2022
1 parent 8fd9156 commit 8884676
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -228,7 +228,7 @@ func (c *client) readResponse(ctx context.Context, resp *ResponsePipe, req *Requ
}
}
close(done)
}()
}(c.conn.rwc)

select {
case <-ctx.Done():
Expand Down

0 comments on commit 8884676

Please sign in to comment.