-
Type:
Backport
-
Resolution: Unresolved
-
Priority:
P4
-
Affects Version/s: 8, 22
-
Component/s: core-libs
Problem
-------
ZIP file processing throws uncaught IllegalArgumentException when handling corrupted UTF-8 sequences in:
- Entry names (ZipInputStream/JarInputStream)
- Entry comments (ZipFile/JarFile only)
- ZIP file comments (ZipFile/JarFile only)
Root Cause
-------
ZipCoder.toStringUTF8() calls StringCoding.newStringUTF8NoRepl() which throws exceptions that are never caught or handled properly.
Affected Components
-------
- ZipInputStream/JarInputStream: Entry names only
- ZipFile/JarFile: Entry comments and ZIP file comments
- All Java versions: 8, 11, 17, 21
Impact
-------
- Frequency: Always reproducible with corrupted UTF-8
- Exception: IllegalArgumentException (uncaught)
- Workaround: Wrap ZIP operations in try/catch blocks
Expected Behavior
-------
Should handle invalid UTF-8 gracefully without throwing uncaught exceptions.
-------
ZIP file processing throws uncaught IllegalArgumentException when handling corrupted UTF-8 sequences in:
- Entry names (ZipInputStream/JarInputStream)
- Entry comments (ZipFile/JarFile only)
- ZIP file comments (ZipFile/JarFile only)
Root Cause
-------
ZipCoder.toStringUTF8() calls StringCoding.newStringUTF8NoRepl() which throws exceptions that are never caught or handled properly.
Affected Components
-------
- ZipInputStream/JarInputStream: Entry names only
- ZipFile/JarFile: Entry comments and ZIP file comments
- All Java versions: 8, 11, 17, 21
Impact
-------
- Frequency: Always reproducible with corrupted UTF-8
- Exception: IllegalArgumentException (uncaught)
- Workaround: Wrap ZIP operations in try/catch blocks
Expected Behavior
-------
Should handle invalid UTF-8 gracefully without throwing uncaught exceptions.
- backport of
-
JDK-8321156 Improve the handling of invalid UTF-8 byte sequences for ZipInputStream::getNextEntry and ZipFile::getComment
-
- Closed
-
- csr for
-
JDK-8372026 Improve the handling of invalid UTF-8 byte sequences for ZipInputStream::getNextEntry and ZipFile::getComment
-
- Draft
-