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

             Bug #: 51559
           Summary: ArrayIndexOutOfBoundsException in 3rd party generated
                    MSG file
           Product: POI
           Version: 3.2-FINAL
          Platform: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: POIFS
        AssignedTo: [email protected]
        ReportedBy: [email protected]
    Classification: Unclassified


Created attachment 27319
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=27319
files causing the problems

In our application we process MS Outlook files (msg) with POIFS.

With the file attached I get various exceptions:

poi-3.2-FINAL
{code}
java.io.IOException: Cannot remove block[ 114 ]; out of range[ 0 - 23 ]
      at
org.apache.poi.poifs.storage.BlockListImpl.remove(BlockListImpl.java:104)
      at
org.apache.poi.poifs.storage.BlockAllocationTableReader.fetchBlocks(BlockAllocationTableReader.java:190)
      at
org.apache.poi.poifs.storage.BlockListImpl.fetchBlocks(BlockListImpl.java:130)
      at
org.apache.poi.poifs.filesystem.POIFSFileSystem.processProperties(POIFSFileSystem.java:524)
      at
org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSystem.java:176)
{code}

POI-3.8 beta 3 and SVN trunk (rev. 1151057)
{code}
java.lang.ArrayIndexOutOfBoundsException: 0
    at
org.apache.poi.poifs.storage.SmallDocumentBlock.getDataInputBlock(SmallDocumentBlock.java:194)
    at
org.apache.poi.poifs.filesystem.POIFSDocument.getDataInputBlock(POIFSDocument.java:282)
    at
org.apache.poi.poifs.filesystem.ODocumentInputStream.getDataInputBlock(ODocumentInputStream.java:107)
    at
org.apache.poi.poifs.filesystem.ODocumentInputStream.<init>(ODocumentInputStream.java:71)
    at
org.apache.poi.poifs.filesystem.DocumentInputStream.<init>(DocumentInputStream.java:60)
{code}

I've also attached a code snippet to reproduce this behaviour.

As this msg file is not produced by Outlook itself but by a 3rd party
application, I'm not sure if there is a bug in POIFS or if the file is corrupt.
The producer of this application argues that Outlook can open that file, so "it
must be correct".

Do you have a hint for me what might be the problem here or possibly a work
around?

Thanks a lot,
Benjamin

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