RFR: 8321156: Improve the handling of invalid UTF-8 byte sequences for ZipInputStream::getNextEntry and ZipFile::getComment

Lance Andersen lancea at openjdk.org
Sat Feb 24 15:01:14 UTC 2024


Please review this PR which addresses the handling of invalid UTF-8 byte sequences in the entry name of a LOC file header and a Zip file comment which is returned via ZipFile::getComment.

As part of the change, `ZipFile::getComment` will now return `null` if an invalid UTF-8 byte sequence is encountered while converting the byte array to a String.  The CSR for this change has also been approved.

Mach5 tiers 1-3 are clean with this change.

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

Commit messages:
 - Add tests for JDK-8321156
 - Merge branch 'master' into JDK-8321156
 - Initial changes for JDK-8321156

Changes: https://git.openjdk.org/jdk/pull/17995/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17995&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8321156
  Stats: 283 lines in 3 files changed: 171 ins; 16 del; 96 mod
  Patch: https://git.openjdk.org/jdk/pull/17995.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/17995/head:pull/17995

PR: https://git.openjdk.org/jdk/pull/17995


More information about the core-libs-dev mailing list