ASF Bugzilla – Attachment 29315 Details for
Bug 53810
[PATCH] fix for incorrect loop detection in NPOIFS
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch fixing cycle detection in NPOI
0001-fix-NPOIFSFileSystem-handling-of-short-block-lists.patch (text/plain), 1.68 KB, created by
Gary King
on 2012-09-01 00:21:58 UTC
(
hide
)
Description:
patch fixing cycle detection in NPOI
Filename:
MIME Type:
Creator:
Gary King
Created:
2012-09-01 00:21:58 UTC
Size:
1.68 KB
patch
obsolete
>From b8d28c97c396739394b7d25df51924363c74c79b Mon Sep 17 00:00:00 2001 >From: Gary King <gking@iongrid.com> >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<bigBlockSize.getXBATEntriesPerBlock(); j++) { >+ >+ int limit = Math.min(bigBlockSize.getXBATEntriesPerBlock(), remain); >+ for(int j=0; j<limit; j++) { > int fatAt = xfat.getValueAt(j); > if(fatAt == POIFSConstants.UNUSED_BLOCK || fatAt == POIFSConstants.END_OF_CHAIN) break; > readBAT(fatAt, loopDetector); > } >+ remain -= limit; > } > > // We're now able to load steams >-- >1.7.3.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 53810
: 29315