8343307: Throw ZipException instead of IAE in ZipFile.Source::initCEN

Reviewed-by: lancea, jpai
This commit is contained in:
Eirik Bjørsnøs 2024-10-31 08:32:48 +00:00
parent 388d44fbf0
commit 2f1ba5ef09

View file

@ -1798,7 +1798,7 @@ public class ZipFile implements ZipConstants, Closeable {
metaVersions = new HashMap<>(); metaVersions = new HashMap<>();
metaVersions.computeIfAbsent(hashCode, _ -> new BitSet()).set(version); metaVersions.computeIfAbsent(hashCode, _ -> new BitSet()).set(version);
} catch (Exception e) { } catch (Exception e) {
throw new IllegalArgumentException(e); zerror("invalid CEN header (bad entry name or comment)");
} }
} }
} }