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: Error zip reader test #7292
Labels
Comments
I don't see the error; the purpose of the test is to check that the UncompressedSize field does not change after f.Open is called. This is because first UncompressedSize is first populated by the directory header (at the end of the zip file), and then updated as Open reads the actual file header (present just before the file body). What's your "fix"? Owner changed to @adg. Status changed to WaitingForReply. |
f.Open() doesn't touch anything, it just calls flate decompress on the data. I thought the purpose of the test was that the value of the UncompressedSize as written in the headers is the same as the actual size of the uncompressed data. The fix would be to move the check after the _, err = io.Copy(&b, r) and compare len(b) with f.size() witch returns UncompresedSize64 if > 0 or UncompresedSize if not. and not UncompressedSize which is useless for 64 archives because it contains 0xFFFFFF. This test fails on zip64.zip |
Ah. Originally, f.Open did re-read the header, but it seems it doesn't do that now. The failure message you're seeing is for tests of ZIP64 files, which populates the UncompressedSize64 field instead. Fix: https://golang.org/cl/61650046 Status changed to Started. |
This issue was closed by revision 413e28d. Status changed to Fixed. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by iacob.campia:
The text was updated successfully, but these errors were encountered: