diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-04-25 04:40:49 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-04-25 04:40:49 +0000 |
commit | 9052430ba6afb2fd9cda644b2adafaf3ebf3f431 (patch) | |
tree | f132ecb5fc0416b24da3356f674b3c069c47a752 /libgo | |
parent | d41b42a65d5c90c8067cca069524f07350a44cb4 (diff) | |
download | gcc-9052430ba6afb2fd9cda644b2adafaf3ebf3f431.tar.gz |
PR go/52341
crypto/rand: Use io.ReadFull when reading from /dev/urandom.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186803 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo')
-rw-r--r-- | libgo/go/crypto/rand/rand_test.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libgo/go/crypto/rand/rand_test.go b/libgo/go/crypto/rand/rand_test.go index be3a5a221d7..da091ba8c73 100644 --- a/libgo/go/crypto/rand/rand_test.go +++ b/libgo/go/crypto/rand/rand_test.go @@ -7,6 +7,7 @@ package rand import ( "bytes" "compress/flate" + "io" "testing" ) @@ -16,9 +17,9 @@ func TestRead(t *testing.T) { n = 1e5 } b := make([]byte, n) - n, err := Read(b) + n, err := io.ReadFull(Reader, b) if n != len(b) || err != nil { - t.Fatalf("Read(buf) = %d, %s", n, err) + t.Fatalf("ReadFull(buf) = %d, %s", n, err) } var z bytes.Buffer |