[release-branch.go1.1] bufio: check buffer availability before reading in ReadFrom

This change was applied by hand, as bufio has seen some refactoring
since 1.1 was branched. The only difference between this and the
original patch is the offset of the change, and s/flush/Flush/.

««« CL 11801043 / 3ffbc06b4874
bufio: check buffer availability before reading in ReadFrom

Fixes  issue 5947 .

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/11801043
»»»

Update #5928

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/12002043
2 files changed