From b8d28c97c396739394b7d25df51924363c74c79b Mon Sep 17 00:00:00 2001 From: Gary King Date: Thu, 30 Aug 2012 17:43:45 -0700 Subject: [PATCH] fix NPOIFSFileSystem handling of short block lists --- .../poi/poifs/filesystem/NPOIFSFileSystem.java | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java b/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java index def2af1..facb748 100644 --- a/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java +++ b/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java @@ -356,6 +356,9 @@ public class NPOIFSFileSystem extends BlockStore readBAT(fatAt, loopDetector); } + + int remain = _header.getBATCount() - _header.getBATArray().length; + // Now read the XFAT blocks, and the FATs within them BATBlock xfat; int nextAt = _header.getXBATIndex(); @@ -366,12 +369,14 @@ public class NPOIFSFileSystem extends BlockStore xfat.setOurBlockIndex(nextAt); nextAt = xfat.getValueAt(bigBlockSize.getXBATEntriesPerBlock()); _xbat_blocks.add(xfat); - - for(int j=0; j