aboutsummaryrefslogtreecommitdiffstats
path: root/poi-scratchpad/src/test/java
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2023-09-08 16:02:13 +0000
committerDominik Stadler <centic@apache.org>2023-09-08 16:02:13 +0000
commit5cb768379d6a26de336117402959d960de5cf91b (patch)
tree9f438e66eda2a2cdf1a129ad3a63db7688848779 /poi-scratchpad/src/test/java
parentf90415ef0ed147a70357cb5f60aa11c95fcc6074 (diff)
downloadpoi-5cb768379d6a26de336117402959d960de5cf91b.tar.gz
poi-5cb768379d6a26de336117402959d960de5cf91b.zip
Bug 66425: Avoid a NullPointerException found via oss-fuzz
We try to avoid throwing NullPointerException, but it was possible to trigger one here with a specially crafted input-file Should fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=62128 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1912199 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-scratchpad/src/test/java')
-rw-r--r--poi-scratchpad/src/test/java/org/apache/poi/hwpf/converter/TestWordToConverterSuite.java8
-rw-r--r--poi-scratchpad/src/test/java/org/apache/poi/hwpf/converter/TestWordToTextConverter.java3
2 files changed, 5 insertions, 6 deletions
diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hwpf/converter/TestWordToConverterSuite.java b/poi-scratchpad/src/test/java/org/apache/poi/hwpf/converter/TestWordToConverterSuite.java
index 71f4327133..a2aac7b19f 100644
--- a/poi-scratchpad/src/test/java/org/apache/poi/hwpf/converter/TestWordToConverterSuite.java
+++ b/poi-scratchpad/src/test/java/org/apache/poi/hwpf/converter/TestWordToConverterSuite.java
@@ -38,8 +38,7 @@ import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
-public class TestWordToConverterSuite
-{
+public class TestWordToConverterSuite {
/**
* YK: a quick hack to exclude failing documents from the suite.
*/
@@ -60,7 +59,8 @@ public class TestWordToConverterSuite
"clusterfuzz-testcase-minimized-POIHWPFFuzzer-5418937293340672.doc",
"TestHPSFWritingFunctionality.doc",
"clusterfuzz-testcase-minimized-POIHWPFFuzzer-4947285593948160.doc",
- "clusterfuzz-testcase-minimized-POIHWPFFuzzer-5440721166139392.doc"
+ "clusterfuzz-testcase-minimized-POIHWPFFuzzer-5440721166139392.doc",
+ "clusterfuzz-testcase-minimized-POIHWPFFuzzer-5050208641482752.doc"
);
public static Stream<Arguments> files() {
@@ -139,6 +139,4 @@ public class TestWordToConverterSuite
// no exceptions
assertNotNull(stringWriter.toString());
}
-
-
}
diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hwpf/converter/TestWordToTextConverter.java b/poi-scratchpad/src/test/java/org/apache/poi/hwpf/converter/TestWordToTextConverter.java
index 30e46e5d9f..2b2cfed94e 100644
--- a/poi-scratchpad/src/test/java/org/apache/poi/hwpf/converter/TestWordToTextConverter.java
+++ b/poi-scratchpad/src/test/java/org/apache/poi/hwpf/converter/TestWordToTextConverter.java
@@ -52,7 +52,8 @@ public class TestWordToTextConverter {
"clusterfuzz-testcase-minimized-POIHWPFFuzzer-5418937293340672.doc",
"TestHPSFWritingFunctionality.doc",
"clusterfuzz-testcase-minimized-POIHWPFFuzzer-4947285593948160.doc",
- "clusterfuzz-testcase-minimized-POIHWPFFuzzer-5440721166139392.doc"
+ "clusterfuzz-testcase-minimized-POIHWPFFuzzer-5440721166139392.doc",
+ "clusterfuzz-testcase-minimized-POIHWPFFuzzer-5050208641482752.doc"
);
/**