You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2011/07/20 18:26:31 UTC
DO NOT REPLY [Bug 51535] New: NPOIFSFileSystem seems to parse row
numbers as signed
https://issues.apache.org/bugzilla/show_bug.cgi?id=51535
Bug #: 51535
Summary: NPOIFSFileSystem seems to parse row numbers as signed
Product: POI
Version: 3.8-dev
Platform: PC
Status: NEW
Severity: normal
Priority: P2
Component: HSSF
AssignedTo: dev@poi.apache.org
ReportedBy: antoni.mylka@aduna-software.com
Classification: Unclassified
Created attachment 27303
--> https://issues.apache.org/bugzilla/attachment.cgi?id=27303
A test document and a junit test case which exposes the issue
When I have a document with data in rows with a high number (say 65535) I get
array index exceptions because row numbers are negative. For instance in
ValueRecordsAggregate in line
CellValueRecordInterface[] rowCells = records[row];
row is -32768
moreover in HSSFSheet
while (row != null) {
createRowFromRecord(row);
row = sheet.getNextRow();
}
There are cases where row.getRowNumber returns a negative int. I tried to
manufacture an example file. It seems that NPOIFS somewhere parses the row
number as a signed number, while it has to be unsigned. I don't know enough POI
to fix this myself but my test case seems to show the problem.
It didn't occur with older POIFS.
--
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 51535] NPOIFSFileSystem seems to parse row numbers
as signed
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51535
--- Comment #2 from Antoni Mylka <an...@aduna-software.com> 2011-08-11 10:46:15 UTC ---
Created attachment 27373
--> https://issues.apache.org/bugzilla/attachment.cgi?id=27373
A patch which seems to fix the issue
NDocumentInputStream.readUShort() method would delegate to
LittleIndian.getShort(). I changed this to LittleIndian.getUShort(). Nothing
else broke, so the lack of 'U' must have been a typo.
--
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 51535] NPOIFSFileSystem seems to parse row numbers
as signed
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51535
Nick Burch <ni...@alfresco.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #3 from Nick Burch <ni...@alfresco.com> 2011-08-11 11:13:14 UTC ---
Ah, good spot!
Fixed, and test re-enabled in r1156573, thanks
--
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 51535] NPOIFSFileSystem seems to parse row numbers
as signed
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51535
Nick Burch <ni...@alfresco.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
OS/Version| |All
--- Comment #1 from Nick Burch <ni...@alfresco.com> 2011-07-21 13:56:50 UTC ---
I've added a slightly tweaked version of your unit test in r1149181. It's
currently disabled as the test fails as described
--
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org