You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. Apply the patch in zipTest.diff
2. Place java.zip in src/pkg/archive/zip/testdata
3. Run "make test" in src/pkg/archive/zip/testdata
What is the expected output?
PASS
What do you see instead?
--- FAIL: zip.TestReader
unexpected EOF
unexpected EOF
unexpected EOF
unexpected EOF
unexpected EOF
unexpected EOF
filename: copy error=unexpected EOF, want checksum error
FAIL
Which compiler are you using (5g, 6g, 8g, gccgo)?
6g
Which operating system are you using?
MacOSX 10.6.5
Which revision are you using? (hg identify)
c88661a2d028+ tip
Please provide any additional information below.
In zip files with 0x8 bit set in the Flags field, the original size, compressed size,
and CRC32 are set to 0 in the FileHeader. The correct values are set in the end of file
directory and in a data structure that appears after the compressed data. This is
documented on wikipedia and at:
https://users.cs.jmu.edu/buchhofp/forensics/formats/pkzip.html
These zip files occur when you use Java's ZipOutputStream to create a zip file and in
other cases where file size isn't known ahead of time.
archive/zip correctly reads the values from the directory structure, but replaces them
with the zero'd values when the user does File.Open(). This leads to an
"unexpected EOF" error because archive/zip believes the compressed data is 0
bytes long.
Three files are attached:
java.zip - an example of a zip file that archive/zip fails to read
(place it in src/pkg/archive/zip/testdata )
zipTest.diff - a diff to add a test case that reads java.zip
zipFix.diff - a patch to fix archive/zip
I am very new to go, so please review the patch and revise as needed.
by dunhamsteve:
Attachments:
The text was updated successfully, but these errors were encountered: