Skip to content
This repository was archived by the owner on May 11, 2020. It is now read-only.

Commit 4ca9570

Browse files
authored
wasm: use io.ReadFull instead of Read
There is no guarantee that io.Read fulfills the given byte slice. ReadByte should use io.ReadFull to ensure that instead. Fixes #188
1 parent a6163ff commit 4ca9570

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

wasm/read.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func writeByte(w io.Writer, b byte) error {
4444

4545
func ReadByte(r io.Reader) (byte, error) {
4646
p := make([]byte, 1)
47-
_, err := r.Read(p)
47+
_, err := io.ReadFull(r, p)
4848
return p[0], err
4949
}
5050

0 commit comments

Comments
 (0)