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
We have decided that in the Go standard library functions are permitted to panic if the input arguments fail their preconditions. For example, functions in the Go standard library do not routinely check whether they have been passed a nil pointer.
What version of Go are you using (
go version
)?What operating system and processor architecture are you using (
go env
)?ubuntu 22.04 on amd64
What did you do?
base64.StdEncoding.Decode
is called with the destination buffer of insufficient sizehttps://go.dev/play/p/8mGzeMnqg5e
What did you expect to see?
either of two seems acceptable:
What did you see instead?
panic: runtime error: index out of range [2] with length 1
which is not only harmful but also misleading as the size of destination buffer is larger than 1
Note
This seemingly existed at least since 1.18 and was already reported but failed to gain attention and was closed after confused discussion: #54532
The text was updated successfully, but these errors were encountered: