https://issues.apache.org/bugzilla/show_bug.cgi?id=57296

            Bug ID: 57296
           Summary: ZipInputStreamZipEntrySource.java:61 should catch
                    IOExceptions on "close" after successfully reading
           Product: POI
           Version: 3.10-FINAL
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: OPC
          Assignee: [email protected]
          Reporter: [email protected]

Beginning with 1.7.0_71 closing a CipherInputStream may result in a
BadPaddingException on closing the stream, signaling there maybe still data
left to read.

Got this in my trace:

Caused by: java.io.IOException: javax.crypto.BadPaddingException: Given final
block not properly padded
    at javax.crypto.CipherInputStream.close(CipherInputStream.java:321)
~[na:1.8.0_25]
    at java.io.BufferedInputStream.close(BufferedInputStream.java:483)
~[na:1.8.0_25]
    at java.io.PushbackInputStream.close(PushbackInputStream.java:379)
~[na:1.8.0_25]
    at java.util.zip.InflaterInputStream.close(InflaterInputStream.java:227)
~[na:1.8.0_25]
    at java.util.zip.ZipInputStream.close(ZipInputStream.java:266)
~[na:1.8.0_25]
    at
org.apache.poi.openxml4j.util.ZipInputStreamZipEntrySource.<init>(ZipInputStreamZipEntrySource.java:61)
~[poi-ooxml-3.10-FINAL-20140208.jar:3.10-FINAL]

This was changed with 71 and was silently ignored before, look here:

https://bugs.openjdk.java.net/browse/JDK-8061

Looking at the code it seems to me, that on the point where the stream is
closed" all is "done" and any IOException on "closing" the stream can be
ignored because there is no ZipEntry left in the ZipInputStreamZipEntrySource,
correct?
Can you please add some fix here, so that close is something like:

try {
 inp.close();
} catch(IOException e) {
 // ignore or log it
}

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to