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
"CRC or size mismatch" when extracting member second time #11
Comments
|
Ok would you mind putting together a pull request that implements this so I can evaluate it? |
|
Thanks for the patch - I'll try to add a test and release. |
|
@AGWA Can you state on here that you release your test code and archives (these in particular) under the same licensing terms as Archive::Zip? This is silly to have to ask but I've seen this trip up acceptance of this sort of stuff into upstream linux distros cough Debian cough I'm working on a test for this now |
|
@pwr22 Thanks for working on this. Yes, I do release my test code and archives under the same licensing terms as Archive::Zip. |
If I try to extract the same member more than once, the second extraction results in:
This only happens with some Zip files. It seems to happen consistently with Zip files created with the jar command.
Here is a test case:
I tracked the problem down to
_writeDatamodifyingcompressedSizeon line 1103 of lib/Archive/Zip/Member.pm:Because
compressedSizehas been modified, the next time that the member is extracted,_skipLocalFileHeaderwill seek an incorrect number of bytes on line 175 of lib/Archive/Zip/ZipFileMember.pm:I don't understand why
compressedSizeis being set in_writeDatato what is essentially the _un_compressed length of the member. If I remove that line, the bug is fixed and Archive::Zip's test suite still passes. Of course, there may be a good reason for that line that I'm not aware of, which is why I'm not submitting a patch. What do you think the correct fix is?Thanks!
The text was updated successfully, but these errors were encountered: