import org.apache.poi.util.Internal;
import org.apache.poi.util.LittleEndianByteArrayInputStream;
-
/**
* This class holds much of the core of a Word document, but
* without some of the table structure information.
DirectoryEntry objectPoolEntry = null;
if (directory.hasEntry(STREAM_OBJECT_POOL)) {
- objectPoolEntry = (DirectoryEntry) directory.getEntry(STREAM_OBJECT_POOL);
+ final Entry entry = directory.getEntry(STREAM_OBJECT_POOL);
+ if (!(entry instanceof DirectoryEntry)) {
+ throw new IllegalArgumentException("Had unexpected type of entry for name: " + STREAM_OBJECT_POOL + ": " + entry.getClass());
+ }
+ objectPoolEntry = (DirectoryEntry) entry;
}
_objectPool = new ObjectPoolImpl(objectPoolEntry);
}
"Fuzzed.doc",
"clusterfuzz-testcase-minimized-POIHWPFFuzzer-5418937293340672.doc",
"TestHPSFWritingFunctionality.doc",
- "clusterfuzz-testcase-minimized-POIHWPFFuzzer-4947285593948160.doc"
+ "clusterfuzz-testcase-minimized-POIHWPFFuzzer-4947285593948160.doc",
+ "clusterfuzz-testcase-minimized-POIHWPFFuzzer-5440721166139392.doc"
);
public static Stream<Arguments> files() {
// Corrupt files
"clusterfuzz-testcase-minimized-POIHWPFFuzzer-5418937293340672.doc",
"TestHPSFWritingFunctionality.doc",
- "clusterfuzz-testcase-minimized-POIHWPFFuzzer-4947285593948160.doc"
+ "clusterfuzz-testcase-minimized-POIHWPFFuzzer-4947285593948160.doc",
+ "clusterfuzz-testcase-minimized-POIHWPFFuzzer-5440721166139392.doc"
);
/**