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
$ go1.17beta1 version
go version go1.17beta1 darwin/amd64
$ gotip version
go version devel go1.17-ff6f2051d9 Tue Jun 22 04:10:24 2021 +0000 darwin/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
darwin/amd64
What did you do?
While experimenting with the awesome new fuzzer, I encountered a class of panics in time.ParseDuration when it receives invalid input and calls into time.quote() to format an error message (playground):
$ gotip run parse_duration_panic.go
panic: runtime error: index out of range [2] with length 2
goroutine 1 [running]:
time.quote({0x10a209b, 0x2})
/Users/adam/sdk/gotip/src/time/format.go:770 +0x45f
time.ParseDuration({0x10a209b, 0x2})
/Users/adam/sdk/gotip/src/time/format.go:1500 +0x393
main.main()
/Users/adam/parse_duration_panic.go:9 +0x25
exit status 2
$ go1.16.5 run parse_duration_panic.go
time: invalid duration "��"
What did you see instead?
$ go1.17beta1 run parse_duration_panic.go
panic: runtime error: index out of range [2] with length 2
goroutine 1 [running]:
time.quote({0x10a209b, 0x2})
/Users/adam/sdk/go1.17beta1/src/time/format.go:770 +0x45f
time.ParseDuration({0x10a209b, 0x2})
/Users/adam/sdk/go1.17beta1/src/time/format.go:1500 +0x393
main.main()
/Users/adam/parse_duration_panic.go:9 +0x25
exit status 2
$ gotip run parse_duration_panic.go
panic: runtime error: index out of range [2] with length 2
goroutine 1 [running]:
time.quote({0x10a209b, 0x2})
/Users/adam/sdk/gotip/src/time/format.go:770 +0x45f
time.ParseDuration({0x10a209b, 0x2})
/Users/adam/sdk/gotip/src/time/format.go:1500 +0x393
main.main()
/Users/adam/parse_duration_panic.go:9 +0x25
exit status 2
The text was updated successfully, but these errors were encountered:
static detection for this could be attempted. I had filled an issue for this as dominikh/go-tools#751 when using utf8.RuneLen. Seems len(string(rune)) is a similar problem case.
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
)?darwin/amd64
What did you do?
While experimenting with the awesome new fuzzer, I encountered a class of panics in time.ParseDuration when it receives invalid input and calls into
time.quote()
to format an error message (playground):time/format.go:770 is in time.quote, which was refactored in https://go-review.googlesource.com/c/go/+/267017, though I haven't bisected to be sure that's the cause.
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: