-
Notifications
You must be signed in to change notification settings - Fork 16
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
Apparently valid ZIP files can be processed by archive/zip but not zipstream #7
Comments
|
Here's the result of running the Go program. The checksum-looking things are the names of files in the ZIP.
|
The only other clue I have is that the problem goes away if I change the original generation code to use the Store compression method everywhere instead of the Deflate method. |
Looking through the code, it looks if the previous file has a set length in the header AND there's some data inserted between the files, then Next() won't find the header it is expecting, while still be a valid zip. But I don't think archive/zip does that. Could you try creating a minimal zip with just the files that cause the issue? i.e. 87, 88 and 89... In the meantime, I'll think about getting the code to skip data until it finds the header. |
You might like to try |
While using zipstream for a project I've encountered a set of ZIP files that pass validation according to tools like
zip -t
, and which can be processed by archive/zip and mholt/archiver, but which can't be processed by zipstream.I originally generated these files using archive/zip, but I also tried using mholt/archiver, and got slightly different files that triggered the same problem. So I don't think the problem is with the generator.
Below is a standalone Go program that opens the file from disk and runs it through archive/zip successfully. It then opens the same file and tries to run it through zipstream.
The file itself is confidential, but I can share it with you privately if you're interested.
The text was updated successfully, but these errors were encountered: