RFD: Invalid CRC in ZipFile, ZipFileSystem

Lance Andersen lance.andersen at oracle.com
Thu Feb 23 16:32:52 UTC 2023


HI Eirik

On Feb 23, 2023, at 7:43 AM, Eirik Bjørsnøs <eirbjo at gmail.com<mailto:eirbjo at gmail.com>> wrote:

Hi,

While writing various ZIP related tests, I noticed a discrepancy in the treatment of invalid CRC values:

While ZipInputStream rejects invalid CRC values when consuming streams, ZipFile and ZipFileSystem do not.

While this is inconsistent, it is perhaps not a bug we want to fix?

I believe it is intentional.  Alan, Martin B, do you recall the history?

In any case, it could perhaps be good to have better test coverage in this area. Here's a test which validates the current behaviour of ZIS, ZF and ZFS:

https://github.com/openjdk/jdk/compare/master...eirbjo:jdk:zip-invalid-crc

I will take a look next week

Thank you for your efforts in this area

Best
Lance

Any thoughts?

Thanks,
Eirik.



[cid:E1C4E2F0-ECD0-4C9D-ADB4-B16CA7BCB7FC at home]






Lance Andersen | Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering
1 Network Drive
Burlington, MA 01803
Lance.Andersen at oracle.com<mailto:Lance.Andersen at oracle.com>



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20230223/7c41d914/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: oracle_sig_logo.gif
Type: image/gif
Size: 658 bytes
Desc: oracle_sig_logo.gif
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20230223/7c41d914/oracle_sig_logo.gif>


More information about the core-libs-dev mailing list