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

             Bug #: 51949
           Summary: ZipFileZipEntrySource - NPE on double close
           Product: POI
           Version: 3.8-dev
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: POI Overall
        AssignedTo: [email protected]
        ReportedBy: [email protected]
    Classification: Unclassified


ZipFileZipEntrySource.close:

    public void close() throws IOException {
        zipArchive.close();
        zipArchive = null;
    }

If close is called twice, this will result in an NPE. Calling close more than
once should not fail, checking for null will prevent this.

Tested with poi 3.8-beta4 used in Tika-0.10.

StackTrace:

java.lang.NullPointerException: null
    at
org.apache.poi.openxml4j.util.ZipFileZipEntrySource.close(ZipFileZipEntrySource.java:37)
~[poi-ooxml-3.8-beta4.jar:3.8-beta4]
    at org.apache.poi.openxml4j.opc.ZipPackage.revertImpl(ZipPackage.java:344)
~[poi-ooxml-3.8-beta4.jar:3.8-beta4]
    at org.apache.poi.openxml4j.opc.OPCPackage.revert(OPCPackage.java:396)
~[poi-ooxml-3.8-beta4.jar:3.8-beta4]
    at org.apache.poi.openxml4j.opc.OPCPackage.close(OPCPackage.java:360)
~[poi-ooxml-3.8-beta4.jar:3.8-beta4]

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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