8193682: Infinite loop in ZipOutputStream.close()

Reviewed-by: lancea, coffeys
This commit is contained in:
Ravi Reddy 2021-12-01 15:35:00 +00:00 committed by Sean Coffey
parent abaa073bcb
commit 1e9ed54d36
4 changed files with 229 additions and 67 deletions

View file

@ -234,9 +234,12 @@ public class DeflaterOutputStream extends FilterOutputStream {
*/
public void close() throws IOException {
if (!closed) {
finish();
if (usesDefaultDeflater)
def.end();
try {
finish();
} finally {
if (usesDefaultDeflater)
def.end();
}
out.close();
closed = true;
}