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: billow...@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-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org

Reply via email to