Subject: | CRC error when re-writing Zip created by LibreOffice |
Date: | Thu, 16 Jan 2014 15:17:50 +0100 |
To: | bug-Archive-Zip [...] rt.cpan.org |
From: | Moritz Bunkus <m.bunkus [...] linet-services.de> |
Hey,
the attached file was created with LibreOffice 4.1.4. It cannot be
re-written with Archive::Zip due to the following stack trace:
format error: CRC or size mismatch while skipping data descriptor
at /usr/share/perl5/vendor_perl/Archive/Zip/ZipFileMember.pm line 195.
Archive::Zip::ZipFileMember::_skipLocalFileHeader('Archive::Zip::ZipFileMember=HASH(0x15a6208)') called at /usr/share/perl5/vendor_perl/Archive/Zip/ZipFileMember.pm line 400
Archive::Zip::ZipFileMember::rewindData('Archive::Zip::ZipFileMember=HASH(0x15a6208)') called at /usr/share/perl5/vendor_perl/Archive/Zip/Member.pm line 1084
Archive::Zip::Member::_writeToFileHandle('Archive::Zip::ZipFileMember=HASH(0x15a6208)', 'IO::File=GLOB(0xf8b920)', 1, 13303) called at /usr/share/perl5/vendor_perl/Archive/Zip/Archive.pm line 428
Archive::Zip::Archive::writeToFileHandle('Archive::Zip::Archive=HASH(0xf8ba58)', 'IO::File=GLOB(0xf8b920)', 1) called at /usr/share/perl5/vendor_perl/Archive/Zip/Archive.pm line 396
Archive::Zip::Archive::writeToFileNamed('Archive::Zip::Archive=HASH(0xf8ba58)', 'out.zip') called at -e line 1
The resulting file is corrupt as writing stops with that error.
Code to reproduce:
perl -MArchive::Zip -e 'my $z = Archive::Zip->new; $z->read(shift); $z->writeToFileNamed("out.zip");' test.odt
This error starts with Archive::Zip v1.31_04 (1.31_03 works nicely) and
persists even today in 1.37. If I manually comment out the lines
in lib/Archive/Member.pm that were introduced in 1.31_04 then it works
again, and the resulting file can be unzipped with the unzip command
line program.
Kind regards,
Moritz
--
Dipl.-Inform. Moritz Bunkus
Geschäftsführer/CTO
LINET Services GmbH | Cyriaksring 10a | 38118 Braunschweig
Tel. 0531-180508-0 | Fax 0531-180508-29 | http://www.linet-services.de
Geschäftsführung: Moritz Bunkus, Philip Reetz und Timo Springmann
HR B 9170 Amtsgericht Braunschweig
USt-IdNr. DE 259 526 516
Message body not shown because it is not plain text.
Message body not shown because it is not plain text.