On Wed, 15 Sep 2021 07:40:35 GMT, Ravi Reddy <rre...@openjdk.org> wrote:

> Hi all,
> 
> Please review this fix for Infinite loop in ZipOutputStream.close().
> The main issue here is when ever there is an exception during close 
> operations on GZip we are not setting the deflator to a finished state which 
> is leading to an infinite loop when we try writing on the same GZip instance( 
> since we use while(!def.finished()) inside the write operation).
> 
> Thanks,
> Ravi

src/java.base/share/classes/java/util/zip/DeflaterOutputStream.java line 249:

> 247:              out.close();
> 248:              closed = true;
> 249:              throw ioe;

Have you tried using try-finally instead?

-------------

PR: https://git.openjdk.java.net/jdk/pull/5522

Reply via email to