Bug 44643 - [PATCH] RecordInputStream.readCompressedUnicode throws exception even if length is zero
Summary: [PATCH] RecordInputStream.readCompressedUnicode throws exception even if leng...
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.0-FINAL
Hardware: PC Windows XP
: P2 blocker (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-19 15:21 UTC by Neil Aggarwal
Modified: 2008-03-20 04:01 UTC (History)
0 users



Attachments
Patch to add check for length equal to zero. (530 bytes, patch)
2008-03-19 15:21 UTC, Neil Aggarwal
Details | Diff
Excel sheet that causes the error (15.50 KB, application/octet-stream)
2008-03-19 15:22 UTC, Neil Aggarwal
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Neil Aggarwal 2008-03-19 15:21:28 UTC
Created attachment 21692 [details]
Patch to add check for length equal to zero.

The method readCompressedUnicode will throw an illegal length exception even if the passed in length is zero.

I added a check to return an empty string when the length is zero.
Comment 1 Neil Aggarwal 2008-03-19 15:22:40 UTC
Created attachment 21693 [details]
Excel sheet that causes the error

Trying to read the attached spreadsheet will cause RecordInputStream to throw an exception.
Comment 2 Nick Burch 2008-03-20 04:01:13 UTC
Thanks for this patch, applied to svn along with a unit test