Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
archive/zip: crash opening zip file with corrupt extras defined #4302
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.
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.
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.