]> Cypherpunks repositories - gostls13.git/commit
bufio: permit r.Reset(r) without infinite recursion
authorIan Lance Taylor <iant@golang.org>
Thu, 9 Feb 2023 03:50:06 +0000 (19:50 -0800)
committerGopher Robot <gobot@golang.org>
Fri, 10 Feb 2023 18:56:01 +0000 (18:56 +0000)
commit851f6fd61425c810959c7ab51e6dc86f8a63c970
tree6a4219e8c16db41df4cdcaf76af4839d385474ff
parenta7fe9ada10c02a7ea61b2909ef7db151d290073f
bufio: permit r.Reset(r) without infinite recursion

This can happen in reasonable code because NewReader(r) can return r,
if r is already a Reader.

Similarly for Writer.

Fixes #58423

Change-Id: Iff9d9265410bee68fbaeb7175369847bd737eb2c
Reviewed-on: https://go-review.googlesource.com/c/go/+/466815
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
src/bufio/bufio.go
src/bufio/bufio_test.go