You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2018/03/08 17:27:25 UTC

[Bug 62165] New: OldExcelExtractor closed NPOIFSFileSystem too early

https://bz.apache.org/bugzilla/show_bug.cgi?id=62165

            Bug ID: 62165
           Summary: OldExcelExtractor closed NPOIFSFileSystem too early
           Product: POI
           Version: 3.17-FINAL
          Hardware: All
                OS: All
            Status: NEW
          Severity: critical
          Priority: P2
         Component: HSSF
          Assignee: dev@poi.apache.org
          Reporter: billowgao@gmail.com
  Target Milestone: ---

Created attachment 35756
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35756&action=edit
OldExcelExtractor patch file to fix the open stream bug

open(InputStream biffStream) closed the NPOIFSFileSystem  right after open
which is wrong. We should only close it when open failed.

The buggy code:
            try {
                open(poifs);
            } finally {
                poifs.close();
            }

Should be:
            try {
                open(poifs);
                toClose = poifs; // Fixed by GR, we should not close it here
            } finally {
                if (toClose == null) {
                    poifs.close();
                }
            }

Attached is the patch file

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 62165] OldExcelExtractor closed NPOIFSFileSystem too early

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62165

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #1 from Dominik Stadler <do...@gmx.at> ---
This should be applied now via r1828377 and will be included in Apache POI
4.0.0, thanks for the bug-report.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org