On Fri, 9 May 2025 07:07:38 GMT, Jaikiran Pai <j...@openjdk.org> wrote:
>> Can I please get a review of this change which addresses the issue noted in >> https://bugs.openjdk.org/browse/JDK-8354799? >> >> `java.util.zip.ZipInputStream` when dealing with a `STORED` entry of zero >> size was missing a CRC check for that entry. The change in this PR addresses >> that and introduces a new jtreg test which reproduces the issue and verifies >> the fix. >> >> tier testing is currently in progress. > > Jaikiran Pai has updated the pull request incrementally with one additional > commit since the last revision: > > Lance's suggestion - use assertThrows() Hello Alan, > > > I'll run some experiments and see what it shows up. > > > > > > Thanks as that will help inform as to whether this will need a > > compatibility knob. > > The crc is calculated as part of the write of the entry and I have not seen > any cases, where the CRC is not 0 for a directory/ 0-length file In addition to Lance's investigation, I also ran some experiments against a large number of jars. The results show that none of them are impacted by this change. More specifically, like Lance notes, the CRC values for the case of empty file data (or directory), the CRC is always 0. So the proposed change in this PR isn't expected to run into a JAR/ZIP which will trigger an exception when this CRC is now checked for such entries. So I think we won't need a configuration property for this case. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25116#issuecomment-2870444933