-
Notifications
You must be signed in to change notification settings - Fork 18k
archive/zip: NewReader panics on negative size #26589
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
This is reproducible with Go 1.10: playground. I suggest that we add a check to |
What is causing the panic though? No input checks? |
I suppose we could just return an error there instead, as it already returns an error. I think adding documentation would be overkill, as -1 for a size seems like something you'd only do by mistake anyway. |
I see @dsnet is assigned. Mind if I go ahead and submit a CL to fix this? |
Go for it. Note that we won't review it until Go 1.11 is out in August, though, so no rush. |
Got it. |
Yep, go for it. |
Change https://golang.org/cl/126617 mentions this issue: |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
have no yet test
What operating system and processor architecture are you using (
go env
)?What did you do?
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
What did you expect to see?
My Question
zip.NewReader
isint64
,and -1 has passed ,the program panic but not return a error.zip.NewReader
has an error as returned value, so the way of design is Reasonable ?The text was updated successfully, but these errors were encountered: