Skip to content
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

encoding/base64: The decoder returned by NewDecoder sometimes drops errors #20476

Closed
akalin opened this issue May 24, 2017 · 1 comment
Closed
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@akalin
Copy link

akalin commented May 24, 2017

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

1.8.2

What operating system and processor architecture are you using (go env)?

darwin amd64

What did you do?

When passing an io.Reader to base64.NewDecoder, if that reader emits valid base64 input and an error, I would expect that error to be propagated. Instead, it is dropped.

Example: https://play.golang.org/p/-sJt1NN9G1

In this case, it's because d.err is set to d.readErr only if the (4-byte) buffer isn't filled by the Read call.

This is split off from #20044 .

@dsnet dsnet added this to the Go1.10 milestone May 24, 2017
@dsnet dsnet added the NeedsFix The path to resolution is known, but the work has not been done. label May 24, 2017
@akalin
Copy link
Author

akalin commented Jun 7, 2017

Similar to #20475, I think this isn't actually a bug, too. Updated test: https://play.golang.org/p/jdYK0CTsjZ

@akalin akalin closed this as completed Jun 7, 2017
@golang golang locked and limited conversation to collaborators Jun 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants