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
Tip: go version devel +a2419221fd Fri Jul 13 00:03:31 2018 +0000 darwin/amd64
Does this issue reproduce with the latest release?
No
What did you do?
Set a GOPROXY env var to a server where it might send incorrect/corrupt zip format when cmd/go sends a GET request to /{module}/@v/{version}.zip to download the zip.
What did you expect to see?
cmd/go should not panic. I expect to see an error indicating that the zip file was incorrect.
The error is happening because we're calling z.Close() in modfetch/fetch.go:93 when err != nil -- looking at zip.OpenReader it always returns nil if there was an error, so I believe it's safe to remove z.Close() from the err check.
The text was updated successfully, but these errors were encountered:
…ROXY
If GOPROXY sends the wrong zip data when cmd/go asks for a module's zip ball,
we should not panic. zip.OpenReader always returns a nil ReadCLoser if err is not nil.
Therefore, it's Okay to remove zip.Close in the err block.
Fixesgolang#26536
What version of Go are you using (
go version
)?Tip: go version devel +a2419221fd Fri Jul 13 00:03:31 2018 +0000 darwin/amd64
Does this issue reproduce with the latest release?
No
What did you do?
Set a GOPROXY env var to a server where it might send incorrect/corrupt zip format when cmd/go sends a GET request to
/{module}/@v/{version}.zip
to download the zip.What did you expect to see?
cmd/go should not panic. I expect to see an error indicating that the zip file was incorrect.
What did you see instead?
The error is happening because we're calling
z.Close()
in modfetch/fetch.go:93 whenerr != nil
-- looking atzip.OpenReader
it always returns nil if there was an error, so I believe it's safe to removez.Close()
from the err check.The text was updated successfully, but these errors were encountered: