https://issues.apache.org/bugzilla/show_bug.cgi?id=53404

          Priority: P2
            Bug ID: 53404
          Assignee: [email protected]
           Summary: IllegalArgumentException: calculated end index is out
                    of allowable range when using HSSFWorkbook#write()
          Severity: critical
    Classification: Unclassified
          Reporter: [email protected]
          Hardware: Macintosh
            Status: NEW
           Version: 3.8
         Component: HSSF
           Product: POI

Created attachment 28922
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28922&action=edit
example test program

When writing to a file using HSSFWorkbook.write() the write fails with the
below stack trace, and wipes out any data existing in the file.

This functionality was introduced in version 3.7b1, and has been confirmed to
exist in the most recent production version as well (v3.8).

I've attached a test program that reliably reproduces this.  To use it unzip
the attachment and review the README file.

-----------------------

Exception in thread "main" java.lang.IllegalArgumentException: calculated end
index (29228) is out of allowable range (29224..29226)
    at
org.apache.poi.util.LittleEndianByteArrayOutputStream.<init>(LittleEndianByteArrayOutputStream.java:41)
    at
org.apache.poi.hssf.record.StandardRecord.serialize(StandardRecord.java:38)
    at
org.apache.poi.hssf.usermodel.HSSFWorkbook$SheetRecordCollector.serialize(HSSFWorkbook.java:1215)
    at
org.apache.poi.hssf.usermodel.HSSFWorkbook.getBytes(HSSFWorkbook.java:1261)
    at org.apache.poi.hssf.usermodel.HSSFWorkbook.write(HSSFWorkbook.java:1160)
    at poifseditor.PoifsEditor.addSomeRows(PoifsEditor.java:45)
    at poifseditor.PoifsEditor.main(PoifsEditor.java:62)

-- 
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]

Reply via email to