diff --git a/src/bufio/bufio.go b/src/bufio/bufio.go index 9ea058db3ed..7483946fc0a 100644 --- a/src/bufio/bufio.go +++ b/src/bufio/bufio.go @@ -244,6 +244,8 @@ func (b *Reader) Read(p []byte) (n int, err error) { } // copy as much as we can + // Note: if the slice panics here, it is probably because + // the underlying reader returned a bad count. See issue 49795. n = copy(p, b.buf[b.r:b.w]) b.r += n b.lastByte = int(b.buf[b.r-1])