You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by GitBox <gi...@apache.org> on 2026/09/07 11:57:56 UTC
[GH] (poi/leak-mapimessage-file): Workflow run "Java CI with Ant" failed!
The GitHub Actions job "Java CI with Ant" on poi.git/leak-mapimessage-file has failed.
Run started by GitHub user pjfanning (triggered by pjfanning).
Head commit for run:
be7d467563fe84f8df23470de687739a8fd1f71e / PJ Fanning <pj...@users.noreply.github.com>
Close the POIFS filesystem when MAPIMessage parsing fails
MAPIMessage(File) and MAPIMessage(String) open a file-backed
POIFSFileSystem and hand it to MAPIMessage(POIFSFileSystem), which
delegates to MAPIMessage(DirectoryNode). That constructor runs
POIFSChunkParser.parse and the chunk sorters with no cleanup, so a
malformed .msg file leaked the RandomAccessFile behind the filesystem.
MAPIMessage(File) is the constructor the javadoc recommends for lower
memory use, so this is the path most likely to be hit.
MAPIMessage(POIFSFileSystem) already takes ownership of the filesystem -
close() closes it via POIDocument.close() - so it is also the right place
to close it when construction does not complete. The chunk parsing moves
into a private parseChunks method, and MAPIMessage(POIFSFileSystem) now
calls super/parseChunks directly rather than delegating, so it can wrap
the parse in a try/catch.
MAPIMessage(DirectoryNode) deliberately keeps no cleanup: it is used for
messages embedded in a filesystem owned by someone else, so closing that
filesystem there would be wrong.
Co-Authored-By: Claude Opus 5 (1M context) <no...@anthropic.com>
Report URL: https://github.com/apache/poi/actions/runs/34116820273
With regards,
GitHub Actions via GitBox
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org