https://bz.apache.org/bugzilla/show_bug.cgi?id=57851

            Bug ID: 57851
           Summary: NPE in NPOIFSFileSystem for corrupted MSG file
           Product: POI
           Version: 3.11-FINAL
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: POIFS
          Assignee: [email protected]
          Reporter: [email protected]

Created attachment 32682
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=32682&action=edit
Problematic file

Constructor of NPOIFSFileSystem throws NPE when given an input stream to a file
created by slightly modifying valid MSG file.

@Test
public void shouldNotThrowNPE() throws IOException {
    InputStream input = ClassLoader.getSystemResourceAsStream("corrupted.msg");
    new NPOIFSFileSystem(input);
}

Resulting stack trace (removed JUnit frames):

java.lang.NullPointerException
    at
org.apache.poi.poifs.property.DirectoryProperty.addChild(DirectoryProperty.java:256)
    at
org.apache.poi.poifs.property.PropertyTableBase.populatePropertyTree(PropertyTableBase.java:115)
    at
org.apache.poi.poifs.property.PropertyTableBase.populatePropertyTree(PropertyTableBase.java:118)
    at
org.apache.poi.poifs.property.PropertyTableBase.<init>(PropertyTableBase.java:63)
    at
org.apache.poi.poifs.property.NPropertyTable.<init>(NPropertyTable.java:66)
    at
org.apache.poi.poifs.filesystem.NPOIFSFileSystem.readCoreContents(NPOIFSFileSystem.java:416)
    at
org.apache.poi.poifs.filesystem.NPOIFSFileSystem.<init>(NPOIFSFileSystem.java:324)
    at
pl.edu.agh.seeker.extractor.mail.MsgExtractorTest.shouldNotThrowNPE(MsgExtractorTest.java:24)

The culprit seems to be
org.apache.poi.poifs.property.PropertyFactory.convertToProperties, which adds
null to the list of properties upon encountering unrecognized property type.

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