Fix NPOIFS to handle dodgy excel-95 file from bug #46904

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1681756 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nick Burch 2015-05-26 13:46:20 +00:00
parent e579b78672
commit e812e61ad3
2 changed files with 1 additions and 4 deletions

View File

@ -436,7 +436,7 @@ public class NPOIFSFileSystem extends BlockStore
List<BATBlock> sbats = new ArrayList<BATBlock>();
_mini_store = new NPOIFSMiniStore(this, _property_table.getRoot(), sbats, _header);
nextAt = _header.getSBATStart();
for(int i=0; i<_header.getSBATCount(); i++) {
for(int i=0; i<_header.getSBATCount() && nextAt != POIFSConstants.END_OF_CHAIN; i++) {
loopDetector.claim(nextAt);
ByteBuffer fatData = getBlockAt(nextAt);
sfat = BATBlock.createBATBlock(bigBlockSize, fatData);

View File

@ -1578,8 +1578,6 @@ public final class TestBugs extends BaseTestBugzillaIssues {
"The supplied spreadsheet seems to be Excel"
));
}
// TODO Fix this to work with NPOIFS as well
/*
try {
NPOIFSFileSystem fs = new NPOIFSFileSystem(
HSSFITestDataProvider.instance.openWorkbookStream("46904.xls"));
@ -1590,7 +1588,6 @@ public final class TestBugs extends BaseTestBugzillaIssues {
"The supplied spreadsheet seems to be Excel"
));
}
*/
}
/**