Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encoding/gob: integer comparison is always false #11279

tzneal opened this issue Jun 19, 2015 · 1 comment

encoding/gob: integer comparison is always false #11279

tzneal opened this issue Jun 19, 2015 · 1 comment


Copy link

@tzneal tzneal commented Jun 19, 2015

encoding/gob/decode.go:637: comparison of identifier nr < 0 is always false

nr is a uint64 and can never be less than zero

func (state *decoderState) decodeUint() (x uint64) {
        b, err := state.b.ReadByte()
        nr := state.decodeUint()
        if nr < 0 || nr > 1<<31 { // zero is permissible for anonymous types
                errorf("invalid type name length %d", nr)
@ianlancetaylor ianlancetaylor added this to the Go1.6 milestone Jun 19, 2015
Copy link

@gopherbot gopherbot commented Aug 25, 2015

CL mentions this issue.

@bradfitz bradfitz closed this in 7ebaa43 Aug 25, 2015
@golang golang locked and limited conversation to collaborators Aug 24, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.