https://issues.apache.org/bugzilla/show_bug.cgi?id=52035
Bug #: 52035
Summary: Large MS Word 6.0 Word Document
java.lang.ArrayIndexOutOfBoundsException: -283137
Product: POI
Version: 3.7
Platform: PC
OS/Version: Linux
Status: NEW
Severity: major
Priority: P2
Component: HWPF
AssignedTo: [email protected]
ReportedBy: [email protected]
Classification: Unclassified
Word6.0 file with 32MB size
It appears that it should be unsigned instead of signed. This patch appears to
fix the problem on read. I checked and it appears to still be a problem against
poi-3.8-beta4.
diff -uNr
../old/poi-3.7/src/scratchpad/src/org/apache/poi/hwpf/model/OldCHPBinTable.java
./src/scratchpad/src/org/apache/poi/hwpf/model/OldCHPBinTable.java
---
../old/poi-3.7/src/scratchpad/src/org/apache/poi/hwpf/model/OldCHPBinTable.java
2010-10-14 04:50:23.000000000 -0600
+++ ./src/scratchpad/src/org/apache/poi/hwpf/model/OldCHPBinTable.java
2011-10-14 17:16:45.414557055 -0600
@@ -49,7 +49,7 @@
{
GenericPropertyNode node = binTable.getProperty(x);
- int pageNum = LittleEndian.getShort(node.getBytes());
+ int pageNum = LittleEndian.getUShort(node.getBytes());
int pageOffset = POIFSConstants.SMALLER_BIG_BLOCK_SIZE * pageNum;
CHPFormattedDiskPage cfkp = new CHPFormattedDiskPage(documentStream,
diff -uNr
../old/poi-3.7/src/scratchpad/src/org/apache/poi/hwpf/model/OldPAPBinTable.java
./src/scratchpad/src/org/apache/poi/hwpf/model/OldPAPBinTable.java
---
../old/poi-3.7/src/scratchpad/src/org/apache/poi/hwpf/model/OldPAPBinTable.java
2010-10-14 04:50:23.000000000 -0600
+++ ./src/scratchpad/src/org/apache/poi/hwpf/model/OldPAPBinTable.java
2011-10-14 17:18:00.047660407 -0600
@@ -40,7 +40,7 @@
{
GenericPropertyNode node = binTable.getProperty(x);
- int pageNum = LittleEndian.getShort(node.getBytes());
+ int pageNum = LittleEndian.getUShort(node.getBytes());
int pageOffset = POIFSConstants.SMALLER_BIG_BLOCK_SIZE * pageNum;
PAPFormattedDiskPage pfkp = new PAPFormattedDiskPage(documentStream,
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]