-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
math/big: panic slice bounds out of range in Rat.GobDecode #56156
Comments
Seems like the issue is with: Lines 56 to 59 in f1e50a1
/cc @rolandshoemaker |
Change https://go.dev/cl/442335 mentions this issue: |
Fixes golang#56156 Change-Id: Ib85ff45f0b0d0eac83c39606ee20b3a312e6e919 Reviewed-on: https://go-review.googlesource.com/c/go/+/442335 Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
This has not been fixed. package main
import (
"math/big"
)
func main() {
buf := []byte{2, 255, 255, 255, 255}
i1 := 32
i2 := 255
r := big.NewRat(int64(i1), int64(i2))
r.GobDecode(buf)
} Will produce the following stack trace:
It has been tested with the latest release. @neild @rolandshoemaker could we get this reopened? |
It has been fixed at tip and will be included in the 1.20 release: https://go.dev/play/p/qsXUXNl_ZK_y?v=gotip It hasn't been backported to 1.19 nor proposed for that. |
Alright, thanks! |
Found by OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=52322
What version of Go are you using (
go version
)?1.19.1 and 1.19.2
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?What did you do?
This program:
... panics with this stacktrace:
What did you expect to see?
No Panic
What did you see instead?
See stacktrace above.
The text was updated successfully, but these errors were encountered: