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

           Summary: Bad Section Length - Section.java
           Product: POI
           Version: 3.5-dev
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: PatchAvailable
          Severity: normal
          Priority: P2
         Component: HSSF
        AssignedTo: [email protected]
        ReportedBy: [email protected]


I've seen a rather odd issue with a spreadsheet that results in the size of the
section length being miscalculated.  The following:

/*
 * Read the section length.
 */
size = (int) LittleEndian.getUInt(src, o1);

returns a negative number that causes an OutOfMemory error.  It appears to be a
valid Excel document (it opens fine in OpenOffice).  My fix for the timebeing
is to throw the following immediately after

if (size < 0) {
    throw new UnsupportedEncodingException("Tried to allocate a section of size
" + size);
}

The document appears to parse fine after that.  Please let me know if you need
any more info, I might well be able to clean up the data in the original
document, but saving in OpenOffice might actually correct the issue.

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

Reply via email to