diff options
-rw-r--r-- | poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java | 6 | ||||
-rw-r--r-- | poi-scratchpad/src/test/java/org/apache/poi/hslf/dev/TestPPTXMLDump.java | 4 | ||||
-rw-r--r-- | test-data/slideshow/clusterfuzz-testcase-minimized-POIHSLFFuzzer-6032591399288832.ppt | bin | 0 -> 83956 bytes | |||
-rw-r--r-- | test-data/spreadsheet/stress.xls | bin | 46592 -> 65536 bytes |
4 files changed, 8 insertions, 2 deletions
diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java index 170f42bfcb..7fa5162a14 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java @@ -404,7 +404,11 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable { return; } - DocumentEntry entry = (DocumentEntry) getDirectory().getEntry("Pictures"); + final Entry en = getDirectory().getEntry("Pictures"); + if (!(en instanceof DocumentEntry)) { + throw new IllegalArgumentException("Had unexpected type of entry for name: Pictures: " + en.getClass()); + } + DocumentEntry entry = (DocumentEntry) en; EscherContainerRecord blipStore = getBlipStore(); byte[] pictstream; try (DocumentInputStream is = getDirectory().createDocumentInputStream(entry)) { diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hslf/dev/TestPPTXMLDump.java b/poi-scratchpad/src/test/java/org/apache/poi/hslf/dev/TestPPTXMLDump.java index 7b85af8ad9..efdf770b26 100644 --- a/poi-scratchpad/src/test/java/org/apache/poi/hslf/dev/TestPPTXMLDump.java +++ b/poi-scratchpad/src/test/java/org/apache/poi/hslf/dev/TestPPTXMLDump.java @@ -21,6 +21,7 @@ import org.apache.poi.hslf.HSLFTestDataSamples; import org.junit.jupiter.api.Test; import java.io.File; +import java.io.IOException; import java.util.Collections; import java.util.HashSet; import java.util.Set; @@ -31,6 +32,7 @@ public class TestPPTXMLDump extends BaseTestPPTIterating { static final Set<String> LOCAL_EXCLUDED = new HashSet<>(); static { LOCAL_EXCLUDED.add("clusterfuzz-testcase-minimized-POIHSLFFuzzer-5306877435838464.ppt"); + LOCAL_EXCLUDED.add("clusterfuzz-testcase-minimized-POIHSLFFuzzer-6032591399288832.ppt"); } @Test @@ -49,7 +51,7 @@ public class TestPPTXMLDump extends BaseTestPPTIterating { void runOneFile(File pFile) throws Exception { try { PPTXMLDump.main(new String[]{pFile.getAbsolutePath()}); - } catch (IndexOutOfBoundsException e) { + } catch (IndexOutOfBoundsException | IOException e) { if (!LOCAL_EXCLUDED.contains(pFile.getName())) { throw e; } diff --git a/test-data/slideshow/clusterfuzz-testcase-minimized-POIHSLFFuzzer-6032591399288832.ppt b/test-data/slideshow/clusterfuzz-testcase-minimized-POIHSLFFuzzer-6032591399288832.ppt Binary files differnew file mode 100644 index 0000000000..62f76c0771 --- /dev/null +++ b/test-data/slideshow/clusterfuzz-testcase-minimized-POIHSLFFuzzer-6032591399288832.ppt diff --git a/test-data/spreadsheet/stress.xls b/test-data/spreadsheet/stress.xls Binary files differindex 00b8ca4dea..493ccd7d83 100644 --- a/test-data/spreadsheet/stress.xls +++ b/test-data/spreadsheet/stress.xls |