Bug 44643

Summary: [PATCH] RecordInputStream.readCompressedUnicode throws exception even if length is zero
Product: POI Reporter: Neil Aggarwal <neil>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: blocker    
Priority: P2    
Version: 3.0-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Attachments: Patch to add check for length equal to zero.
Excel sheet that causes the error

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