]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.7] io: fix infinite loop bug in MultiReader
authorBrad Fitzpatrick <bradfitz@golang.org>
Fri, 19 Aug 2016 02:21:26 +0000 (19:21 -0700)
committerChris Broadfoot <cbro@golang.org>
Wed, 7 Sep 2016 17:45:58 +0000 (17:45 +0000)
commite464c08beffc87cb064e48932699042b3dccc491
treeef42450e16634fe8cb6e361ee995cd6e9db4657f
parentc0f5de1ad275cf9a2d7f572be76e7b10fcd3e48f
[release-branch.go1.7] io: fix infinite loop bug in MultiReader

If an io.Reader returned (non-zero, EOF), MultiReader would yield
bytes forever.

This bug has existed before Go 1 (!!), introduced in the original
MultiReader implementation in https://golang.org/cl/1764043 and also
survived basically the only update to this code since then
(https://golang.org/cl/17873, git rev ccdca832c), which was added in
Go 1.7.

This just bit me when writing a test for some unrelated code.

Fixes #16795

Change-Id: I36e6a701269793935d19a47ac12f67b07179fbff
Reviewed-on: https://go-review.googlesource.com/27397
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
Reviewed-on: https://go-review.googlesource.com/28633
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/io/multi.go
src/io/multi_test.go