RFR: 8321802: (zipfs) Add validation of incorrect LOC signature in ZipFileSystem

Lance Andersen lancea at openjdk.org
Tue Dec 12 11:50:33 UTC 2023


On Mon, 11 Dec 2023 15:38:28 GMT, Eirik Bjorsnos <duke at openjdk.org> wrote:

> Please review this PR which adds validation of incorrect LOC signatures in `ZipFileSystem`.
> 
> `ZipFile` already rejects the case where the  offset pointed to from the CEN header does not start with the expected LOC signature. It makes sense to add this check to `ZipFileSystem` as well.

src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java line 2579:

> 2577:                 }
> 2578:                 if (LOCSIG(buf) != LOCSIG) {
> 2579:                     throw new ZipException("invalid loc header (bad signature)");

Please change loc -> LOC

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17059#discussion_r1423879142


More information about the nio-dev mailing list