diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/PPDrawing.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/PPDrawing.java index 267034076a..886468362e 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/PPDrawing.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/PPDrawing.java @@ -47,6 +47,7 @@ import org.apache.poi.ddf.EscherSpgrRecord; import org.apache.poi.ddf.EscherTextboxRecord; import org.apache.poi.sl.usermodel.ShapeType; import org.apache.poi.util.GenericRecordUtil; +import org.apache.poi.util.IOUtils; import org.apache.poi.util.LittleEndian; /** @@ -65,6 +66,7 @@ import org.apache.poi.util.LittleEndian; // would require a wrapping class public final class PPDrawing extends RecordAtom implements Iterable { + public static final int MAX_RECORD_SIZE = 20_000_000; private final byte[] _header; private long _type; @@ -214,8 +216,9 @@ public final class PPDrawing extends RecordAtom implements Iterable LOCAL_EXCLUDED = new HashSet<>(); static { LOCAL_EXCLUDED.add("clusterfuzz-testcase-minimized-POIHSLFFuzzer-6360479850954752.ppt"); + LOCAL_EXCLUDED.add("clusterfuzz-testcase-minimized-POIHSLFFuzzer-6028723156746240.ppt"); } @Test @@ -58,7 +60,7 @@ public class TestSlideShowRecordDumper extends BaseTestPPTIterating { void runOneFile(File pFile) throws Exception { try { SlideShowRecordDumper.main(new String[]{pFile.getAbsolutePath()}); - } catch (IllegalStateException e) { + } catch (IllegalStateException | RecordFormatException e) { if (!LOCAL_EXCLUDED.contains(pFile.getName())) { throw e; } diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hslf/dev/TestUserEditAndPersistListing.java b/poi-scratchpad/src/test/java/org/apache/poi/hslf/dev/TestUserEditAndPersistListing.java index fab8679776..e639e292b0 100644 --- a/poi-scratchpad/src/test/java/org/apache/poi/hslf/dev/TestUserEditAndPersistListing.java +++ b/poi-scratchpad/src/test/java/org/apache/poi/hslf/dev/TestUserEditAndPersistListing.java @@ -24,12 +24,14 @@ import java.util.HashSet; import java.util.Set; import org.apache.poi.EmptyFileException; +import org.apache.poi.util.RecordFormatException; import org.junit.jupiter.api.Test; public class TestUserEditAndPersistListing extends BaseTestPPTIterating { static final Set LOCAL_EXCLUDED = new HashSet<>(); static { LOCAL_EXCLUDED.add("clusterfuzz-testcase-minimized-POIHSLFFuzzer-6360479850954752.ppt"); + LOCAL_EXCLUDED.add("clusterfuzz-testcase-minimized-POIHSLFFuzzer-6028723156746240.ppt"); } @Test @@ -42,7 +44,7 @@ public class TestUserEditAndPersistListing extends BaseTestPPTIterating { void runOneFile(File pFile) throws Exception { try { UserEditAndPersistListing.main(new String[]{pFile.getAbsolutePath()}); - } catch (IllegalStateException e) { + } catch (IllegalStateException | RecordFormatException e) { if (!LOCAL_EXCLUDED.contains(pFile.getName())) { throw e; } diff --git a/test-data/slideshow/clusterfuzz-testcase-minimized-POIHSLFFuzzer-6028723156746240.ppt b/test-data/slideshow/clusterfuzz-testcase-minimized-POIHSLFFuzzer-6028723156746240.ppt new file mode 100644 index 0000000000..96793914be Binary files /dev/null and b/test-data/slideshow/clusterfuzz-testcase-minimized-POIHSLFFuzzer-6028723156746240.ppt differ diff --git a/test-data/spreadsheet/stress.xls b/test-data/spreadsheet/stress.xls index 18508cf972..a4ba77404e 100644 Binary files a/test-data/spreadsheet/stress.xls and b/test-data/spreadsheet/stress.xls differ