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: panic decoding into local type, received remote type [1.21 backport] #62154

Closed
gopherbot opened this issue Aug 19, 2023 · 3 comments
Labels
CherryPickApproved Used during the release process for point releases
Milestone

Comments

@gopherbot
Copy link

@panjf2000 requested issue #62117 to be considered for backport to the next 1.21 minor release.

@gopherbot please consider this for backport to 1.21, this issue may have a wide impact.

@gopherbot gopherbot added the CherryPickCandidate Used during the release process for point releases label Aug 19, 2023
@gopherbot gopherbot added this to the Go1.21.1 milestone Aug 19, 2023
@gopherbot
Copy link
Author

Change https://go.dev/cl/521156 mentions this issue: [release-branch.go1.21] encoding/gob: prevent panic from index out of range in Decoder.typeString

@cagedmantis cagedmantis added the CherryPickApproved Used during the release process for point releases label Aug 23, 2023
@gopherbot gopherbot removed the CherryPickCandidate Used during the release process for point releases label Aug 23, 2023
@cagedmantis
Copy link
Contributor

Approved as this is a serious issue without a workaround.

@gopherbot
Copy link
Author

Closed by merging 745b81b to release-branch.go1.21.

gopherbot pushed a commit that referenced this issue Aug 25, 2023
… range in Decoder.typeString

I believe this bug is introduced by CL 460543 which optimizes the allocations
by changing the type of `idToType` from map to slice, but didn't update the
access code in `Decoder.typeString` that is safe for map but not for slice.

For #62117
Fixes #62154

Change-Id: I0f2e4cc2f34c54dada1f83458ba512a6fde6dcbe
Reviewed-on: https://go-review.googlesource.com/c/go/+/520757
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Andy Pan <panjf2000@gmail.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
(cherry picked from commit ba626ac)
Reviewed-on: https://go-review.googlesource.com/c/go/+/521156
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CherryPickApproved Used during the release process for point releases
Projects
None yet
Development

No branches or pull requests

2 participants