aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java6
-rw-r--r--test-data/spreadsheet/clusterfuzz-testcase-minimized-XLSX2CSVFuzzer-6504225896792064.xlsxbin0 -> 10245 bytes
-rw-r--r--test-data/spreadsheet/stress.xlsbin51712 -> 52224 bytes
3 files changed, 4 insertions, 2 deletions
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java
index 07d00bd99a..590251960a 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java
@@ -259,7 +259,7 @@ public class ReadOnlySharedStringsTable extends DefaultHandler implements Shared
} else if ("rPh".equals(localName)) {
inRPh = true;
//append space...this assumes that rPh always comes after regular <t>
- if (includePhoneticRuns && characters.length() > 0) {
+ if (includePhoneticRuns && characters != null && characters.length() > 0) {
characters.append(" ");
}
}
@@ -287,7 +287,9 @@ public class ReadOnlySharedStringsTable extends DefaultHandler implements Shared
public void characters(char[] ch, int start, int length) throws SAXException {
if (tIsOpen) {
if (inRPh && includePhoneticRuns) {
- characters.append(ch, start, length);
+ if (characters != null) {
+ characters.append(ch, start, length);
+ }
} else if (! inRPh){
if (characters != null) {
characters.append(ch, start, length);
diff --git a/test-data/spreadsheet/clusterfuzz-testcase-minimized-XLSX2CSVFuzzer-6504225896792064.xlsx b/test-data/spreadsheet/clusterfuzz-testcase-minimized-XLSX2CSVFuzzer-6504225896792064.xlsx
new file mode 100644
index 0000000000..9426600d72
--- /dev/null
+++ b/test-data/spreadsheet/clusterfuzz-testcase-minimized-XLSX2CSVFuzzer-6504225896792064.xlsx
Binary files differ
diff --git a/test-data/spreadsheet/stress.xls b/test-data/spreadsheet/stress.xls
index d1b01472d3..b797f92f28 100644
--- a/test-data/spreadsheet/stress.xls
+++ b/test-data/spreadsheet/stress.xls
Binary files differ