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

archive/zip: crash opening zip file with corrupt extras defined #4302

Closed
dustin opened this issue Oct 29, 2012 · 3 comments
Closed

archive/zip: crash opening zip file with corrupt extras defined #4302

dustin opened this issue Oct 29, 2012 · 3 comments
Milestone

Comments

@dustin
Copy link

dustin commented Oct 29, 2012

I've got some code that stores timestamps in an extras header in a zip.  As of some
post-1.0.3 version, one of my tests started failing.  I've got it narrowed down to
approximately the following:

http://play.golang.org/p/kfigcf76RE

If you comment out the Extras in the header, the test passes fine.
@davecheney
Copy link
Contributor

Comment 1:

I believe the problem is the Extra data needs to include its own tag and len headers.
While I cannot find a tag for nano time headers, I can at fix zip.Reader to avoid
panicing when reading a corrupt Extra header.

Labels changed: added priority-later, removed priority-triage.

Owner changed to @davecheney.

Status changed to Started.

@dustin
Copy link
Author

dustin commented Oct 30, 2012

Comment 2:

Thanks for the education on this, too.  Supplying the right input at the time I'm
writing the zipfile (and reading it back out properly) makes my app happy again.
It may be good to build a reader/writer utility for extras.  I ended up with something
that looks a little too much like the reader code.

@davecheney
Copy link
Contributor

Comment 3:

This issue was closed by revision 640d818.

Status changed to Fixed.

@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants