one more case where the JDK throwing RuntimeEx may hurt us
similar to
Credit to OSS-Fuzz
@@ -818,7 +818,13 @@ protected void finalize() throws Throwable {
final byte[] cdExtraData = new byte[extraLen];
IOUtils.readFully(archive, ByteBuffer.wrap(cdExtraData));
+ try {
ze.setCentralDirectoryExtra(cdExtraData);
+ } catch (RuntimeException ex) {
+ final ZipException z = new ZipException("Invalid extra data in entry " + ze.getName());
+ z.initCause(ex);
+ throw z;
+ }
setSizesAndOffsetFromZip64Extra(ze);
