On Mon, 30 Nov 2026 20:08:41 GMT, Lance Andersen <[email protected]> wrote:

> Hi all,
> 
> This PR  is similar to 
> [JDK-8396845](https://bugs.openjdk.org/browse/JDK-8396845) which moves the 
> CEN Header size validation in ZipFileSystem::writeCEN after the extended 
> timestamp calculation which can result in the extra field length and extra 
> field data being modified.
> 
> Mach5 tier1 - tier3 ran cleanly
> 
> 
> 
> ---------
> - [X] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

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

> 3122:             long headerSize = (long)CENHDR + nlen + clen + elen + 
> elen64 + elenNTFS + elenEXTT;
> 3123:             if (headerSize > 0xFFFF ) {
> 3124:                 throw new ZipException("invalid CEN header (bad header 
> size)");

The close method invokes sync before it closes the channel. Do you mind 
checking this as it looks like the ch.close will be skipped if sync throws 
ZipException (or any exception so applies to other writing ops too).

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

PR Review Comment: https://git.openjdk.org/jdk/pull/34136#discussion_r4751349862

Reply via email to