-
Notifications
You must be signed in to change notification settings - Fork 18k
encoding/base32: uses more space in buffer than returned in EncodedLen method #53606
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
Comments
The Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only. For asking questions, see the resources listed at https://go.dev/wiki/Questions. |
Docs explicit state "writing EncodedLen(len(src)) bytes to dst", but it the example above it is writing EncodedLen(len(src)) +6 Bytes |
Writing bytes into a slice does not resize the slice. |
So then why the encoding/base64 does not append '0' characters at the end? |
In some weird cases it could lead to security issues: https://go.dev/play/p/V-Mj6YDR_E4 |
For questions, please see https://go.dev/wiki/Questions. Thanks. |
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
OutputWhat did you do?
https://go.dev/play/p/nv53zKwHz3E
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: