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

Don't perform io.ReadAll on http response #4

Open
brianredbeard opened this issue Jan 19, 2016 · 1 comment
Open

Don't perform io.ReadAll on http response #4

brianredbeard opened this issue Jan 19, 2016 · 1 comment
Labels

Comments

@brianredbeard
Copy link
Owner

As per @mischief:

[15:43]  don't readfull here https://github.com/brianredbeard/gpget/blob/master/main.go#L136
[15:43]  your File.content could probably just be a io.Reader
[15:44]  if someone tries to e.g. download a 8G disk image with this, and they only have 8G memory, it will just OOM

Fixes issue called out in TODO.md

@brianredbeard
Copy link
Owner Author

One thing with this is that the user should be able to make an active decision about if this ever touches the disk. In that case io.ReadAll may be an appropriate answer (as it is in the case of the signatures since they should be completely discarded after use). Will continue to explore further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant