On Mon, 30 Nov 2026 12:05:26 GMT, Timofei Fedotov <[email protected]> wrote:

> ZipInputStream.readLOC() calls ZipEntry.setExtra0() without translating 
> IllegalArgumentException into ZipException. setExtra0() rejects a local entry 
> when the combined central-header size, entry name, and extra field exceeds 
> 65535 bytes.
> 
> For example, an empty entry name with an extra-field length of 65490 causes 
> IllegalArgumentException from getNextEntry(). The same input also causes the 
> JarInputStream constructor to throw the unchecked exception instead of its 
> documented IOException.
> 
> Malformed local headers should be rejected with ZipException. The exception 
> translation should cover both entry creation and extra-field processing so 
> that all invalid LOC length combinations follow the public IOException 
> contract.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

This pull request has now been integrated.

Changeset: cf3cf6b3
Author:    Timofei Fedotov <[email protected]>
Committer: Artem Semenov <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/cf3cf6b33e9e9851173958b32be42ae01173fbb8
Stats:     188 lines in 2 files changed: 185 ins; 0 del; 3 mod

8398547: Oversized LOC extra field causes IllegalArgumentException in 
ZipInputStream

Reviewed-by: lancea, asemenov, alanb

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

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

Reply via email to