This is an automated email from the ASF dual-hosted git repository.
fanningpj pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/poi.git
The following commit(s) were added to refs/heads/trunk by this push:
new 8d71c1f2ff add poifs test
8d71c1f2ff is described below
commit 8d71c1f2ffc616bae6ba213af856f019027956a5
Author: PJ Fanning <[email protected]>
AuthorDate: Wed Jul 30 18:54:05 2025 +0100
add poifs test
---
.../apache/poi/poifs/filesystem/TestPOIFSStream.java | 10 ++++++++++
test-data/poifs/deep-data.bin | Bin 0 -> 774656 bytes
2 files changed, 10 insertions(+)
diff --git
a/poi/src/test/java/org/apache/poi/poifs/filesystem/TestPOIFSStream.java
b/poi/src/test/java/org/apache/poi/poifs/filesystem/TestPOIFSStream.java
index dcbf5145a0..9dd6043ae1 100644
--- a/poi/src/test/java/org/apache/poi/poifs/filesystem/TestPOIFSStream.java
+++ b/poi/src/test/java/org/apache/poi/poifs/filesystem/TestPOIFSStream.java
@@ -2734,6 +2734,15 @@ final class TestPOIFSStream {
}
}
+ @Test
+ void testDeepData() throws IOException {
+ try (InputStream stream =
POIDataSamples.getPOIFSInstance().openResourceAsStream("deep-data.bin")) {
+ IOException ex = assertThrows(IOException.class,
+ () -> new POIFSFileSystem(stream));
+ assertEquals("Property tree too deep, likely a corrupt file",
ex.getMessage());
+ }
+ }
+
@Disabled("Takes a long time to run")
@Test
void performance() throws Exception {
@@ -2781,4 +2790,5 @@ final class TestPOIFSStream {
}
}
}
+
}
diff --git a/test-data/poifs/deep-data.bin b/test-data/poifs/deep-data.bin
new file mode 100644
index 0000000000..a06aae8694
Binary files /dev/null and b/test-data/poifs/deep-data.bin differ
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]