Skip to content

Commit 22dbb42

Browse files
committed
handle possible nil access violation when attempting to read next compressed packet
1 parent 5895dda commit 22dbb42

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packet/conn.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ func (c *Conn) copyN(dst io.Writer, src io.Reader, n int64) (written int64, err
206206
}
207207

208208
// now read the remaining bytes into the buffer containing the first read bytes
209-
rd, err = io.ReadAtLeast(c.compressedReader, buf[rd:], bcap-rd)
209+
rd, err = io.ReadAtLeast(c.currentPacketReader(), buf[rd:], bcap-rd)
210210
n -= int64(rd)
211211
}
212212

0 commit comments

Comments
 (0)