gpget icon indicating copy to clipboard operation
gpget copied to clipboard

Don't perform io.ReadAll on http response

Open brianredbeard opened this issue 9 years ago • 1 comments

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 avatar Jan 19 '16 23:01 brianredbeard

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.

brianredbeard avatar Feb 23 '16 17:02 brianredbeard