Browse Source

Bug 66425: Avoid exceptions found via poi-fuzz

Change an assertion which can be triggered via an
input-document.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=63309

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1914403 13f79535-47bb-0310-9956-ffa450edef68
pull/562/head
Dominik Stadler 5 months ago
parent
commit
c7329fbd38

+ 3
- 1
poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/PICFAndOfficeArtData.java View File

@@ -88,7 +88,9 @@ public class PICFAndOfficeArtData {

// [MS-ODRAW] allows for multiple records in a OfficeArtInlineSpContainer, which is what we're parsing here.
// However, in the context of a HWPF document, there should be only 1.
assert _blipRecords.size() == 1;
if (_blipRecords.size() != 1) {
throw new IllegalStateException("Should only have one BLIP-Record, but had: " + _blipRecords.size());
}
}
}


+ 2
- 1
poi-scratchpad/src/test/java/org/apache/poi/hwpf/converter/TestWordToConverterSuite.java View File

@@ -60,7 +60,8 @@ public class TestWordToConverterSuite {
"TestHPSFWritingFunctionality.doc",
"clusterfuzz-testcase-minimized-POIHWPFFuzzer-4947285593948160.doc",
"clusterfuzz-testcase-minimized-POIHWPFFuzzer-5440721166139392.doc",
"clusterfuzz-testcase-minimized-POIHWPFFuzzer-5050208641482752.doc"
"clusterfuzz-testcase-minimized-POIHWPFFuzzer-5050208641482752.doc",
"clusterfuzz-testcase-minimized-POIHWPFFuzzer-4892412469968896.doc"
);

public static Stream<Arguments> files() {

+ 2
- 1
poi-scratchpad/src/test/java/org/apache/poi/hwpf/converter/TestWordToTextConverter.java View File

@@ -53,7 +53,8 @@ public class TestWordToTextConverter {
"TestHPSFWritingFunctionality.doc",
"clusterfuzz-testcase-minimized-POIHWPFFuzzer-4947285593948160.doc",
"clusterfuzz-testcase-minimized-POIHWPFFuzzer-5440721166139392.doc",
"clusterfuzz-testcase-minimized-POIHWPFFuzzer-5050208641482752.doc"
"clusterfuzz-testcase-minimized-POIHWPFFuzzer-5050208641482752.doc",
"clusterfuzz-testcase-minimized-POIHWPFFuzzer-4892412469968896.doc"
);

/**

BIN
test-data/document/clusterfuzz-testcase-minimized-POIHWPFFuzzer-4892412469968896.doc View File


BIN
test-data/spreadsheet/stress.xls View File


Loading…
Cancel
Save