RFR: 8272746: ZipFile can't open big file (NegativeArraySizeException)

Masanori Yano myano at openjdk.java.net
Thu Dec 23 11:03:45 UTC 2021


Could you please review the JDK-8272746 bug fixes?
Since the array index is of type int, the overflow occurs when the value of end.cenlen is too large because of too many entries.
It is necessary to read a part of the CEN from the file to fix the problem fundamentally, but the way will require an extensive fix and degrade performance.
In practical terms, the size of the central directory rarely grows that large. So, I fixed it to check the size of the central directory and throw an exception if it is too large.

-------------

Commit messages:
 - 8272746: ZipFile can't open big file (NegativeArraySizeException)

Changes: https://git.openjdk.java.net/jdk/pull/6927/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=6927&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8272746
  Stats: 80 lines in 2 files changed: 80 ins; 0 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/6927.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/6927/head:pull/6927

PR: https://git.openjdk.java.net/jdk/pull/6927


More information about the core-libs-dev mailing list