From: Todd Neal Date: Mon, 24 Aug 2015 23:30:53 +0000 (-0500) Subject: encoding/gob: remove always false comparison X-Git-Tag: go1.6beta1~1281 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=7ebaa43754872d4da1f58e8fbd2d2db077af5f0f;p=gostls13.git encoding/gob: remove always false comparison This is not a functional change. nr is a uint64 and can never be less than zero, remove the no-op comparison. Fixes #11279 Change-Id: Iebb36cc8fe97428b503e65d01b5e67d2b2bc7369 Reviewed-on: https://go-review.googlesource.com/13876 Run-TryBot: Todd Neal Reviewed-by: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- diff --git a/src/encoding/gob/decode.go b/src/encoding/gob/decode.go index e913f15c54..ef536b32b2 100644 --- a/src/encoding/gob/decode.go +++ b/src/encoding/gob/decode.go @@ -634,7 +634,7 @@ func (dec *Decoder) ignoreSlice(state *decoderState, elemOp decOp) { func (dec *Decoder) decodeInterface(ityp reflect.Type, state *decoderState, value reflect.Value) { // Read the name of the concrete type. nr := state.decodeUint() - if nr < 0 || nr > 1<<31 { // zero is permissible for anonymous types + if nr > 1<<31 { // zero is permissible for anonymous types errorf("invalid type name length %d", nr) } if nr > uint64(state.b.Len()) {