mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8278794: Infinite loop in DeflaterOutputStream.finish()
Reviewed-by: coffeys, lancea
This commit is contained in:
parent
b2aa085e67
commit
ff0b0927a2
5 changed files with 231 additions and 154 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1996, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -314,7 +314,7 @@ public class ZipOutputStream extends DeflaterOutputStream implements ZipConstant
|
|||
crc.reset();
|
||||
current = null;
|
||||
} catch (IOException e) {
|
||||
if (usesDefaultDeflater && !(e instanceof ZipException))
|
||||
if (def.shouldFinish() && usesDefaultDeflater && !(e instanceof ZipException))
|
||||
def.end();
|
||||
throw e;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue