Skip to content

Commit

Permalink
8341597: ZipFileInflaterInputStream input buffer size uses uncompress…
Browse files Browse the repository at this point in the history
…ed size

Reviewed-by: lancea
  • Loading branch information
Eirik Bjørsnøs committed Oct 8, 2024
1 parent 59ac703 commit f62dba3
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/java.base/share/classes/java/util/zip/ZipFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -411,13 +411,10 @@ public InputStream getInputStream(ZipEntry entry) throws IOException {
case DEFLATED:
// Inflater likes a bit of slack
// MORE: Compute good size for inflater stream:
long size = CENLEN(zsrc.cen, pos) + 2;
long size = CENSIZ(zsrc.cen, pos);
if (size > 65536) {
size = 8192;
}
if (size <= 0) {
size = 4096;
}
InputStream is = new ZipFileInflaterInputStream(in, res, (int) size);
synchronized (istreams) {
istreams.add(is);
Expand Down

0 comments on commit f62dba3

Please sign in to comment.