diff --git a/src/pkg/encoding/gob/decoder.go b/src/pkg/encoding/gob/decoder.go index 5e684d3ee7e..fb28c8caf53 100644 --- a/src/pkg/encoding/gob/decoder.go +++ b/src/pkg/encoding/gob/decoder.go @@ -75,7 +75,9 @@ func (dec *Decoder) recvMessage() bool { dec.err = err return false } - if nbytes >= 1<<31 { + // Upper limit of 1GB, allowing room to grow a little without overflow. + // TODO: We might want more control over this limit. + if nbytes >= 1<<30 { dec.err = errBadCount return false } diff --git a/src/pkg/encoding/gob/gobencdec_test.go b/src/pkg/encoding/gob/gobencdec_test.go index b8dfeeb5156..83644c0331b 100644 --- a/src/pkg/encoding/gob/gobencdec_test.go +++ b/src/pkg/encoding/gob/gobencdec_test.go @@ -547,7 +547,6 @@ func (a isZeroBugArray) GobEncode() (b []byte, e error) { } func (a *isZeroBugArray) GobDecode(data []byte) error { - println("DECODE") if len(data) != len(a) { return io.EOF }