You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: the issue only occurs targeting architectures for which an int is 32 bits. I can easily trigger the problem by building with GOARCH=386.
What did you do?
Hash a large amount of data (length large than a platform int), save the hash using binary.Marshal, restore it using binary.Unmarshal, and then try to Sum it.
(Note: this is the same problem as in #29517, but in the crypto/sha512 package. Fix will be similar)
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
Note: the issue only occurs targeting architectures for which an
int
is 32 bits. I can easily trigger the problem by building with GOARCH=386.What did you do?
Hash a large amount of data (length large than a platform int), save the hash using
binary.Marshal
, restore it usingbinary.Unmarshal
, and then try toSum
it.This play.golang.org link contains a simple example that triggers the issue:
https://play.golang.org/p/Xfs6W_SnKhb
When I run it there, the arch I see is amd64p32, so the issue occurs.
What did you expect to see?
I expect to be able to successfully get a checksum for the unmarshaled sha512 without panic.
What did you see instead?
Upon calling
h.Sum(nil)
, I get a panic similar to:Possible resolution
Fix cast in unmarshal code (as in #29517)
The text was updated successfully, but these errors were encountered: