Browse Source

Bug 66425: Avoid exceptions found via poi-fuzz

Prevent NullPointerException

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

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1915006 13f79535-47bb-0310-9956-ffa450edef68
pull/571/head
Dominik Stadler 3 months ago
parent
commit
a27029d1af

+ 5
- 3
poi/src/main/java/org/apache/poi/hssf/record/FeatRecord.java View File

@@ -132,13 +132,15 @@ public final class FeatRecord extends StandardRecord {
cellRef.serialize(out);
}

sharedFeature.serialize(out);
if (sharedFeature != null) {
sharedFeature.serialize(out);
}
}

protected int getDataSize() {
return 12 + 2+1+4+2+4+2+
(cellRefs.length * CellRangeAddress.ENCODED_SIZE)
+sharedFeature.getDataSize();
(cellRefs.length * CellRangeAddress.ENCODED_SIZE) +
(sharedFeature == null ? 0 : sharedFeature.getDataSize());
}

public int getIsf_sharedFeatureType() {

+ 1
- 0
poi/src/test/java/org/apache/poi/hssf/dev/TestBiffViewer.java View File

@@ -45,6 +45,7 @@ class TestBiffViewer extends BaseTestIteratingXLS {
excludes.put("clusterfuzz-testcase-minimized-POIHSSFFuzzer-5786329142919168.xls", IllegalStateException.class);
excludes.put("clusterfuzz-testcase-minimized-POIHSSFFuzzer-5889658057523200.xls", IndexOutOfBoundsException.class);
excludes.put("clusterfuzz-testcase-minimized-POIHSSFFuzzer-5175219985448960.xls", IndexOutOfBoundsException.class);
excludes.put("clusterfuzz-testcase-minimized-POIHSSFFuzzer-6137883240824832.xls", IndexOutOfBoundsException.class);

return excludes;
}

+ 2
- 0
poi/src/test/java/org/apache/poi/hssf/dev/TestRecordLister.java View File

@@ -48,6 +48,8 @@ class TestRecordLister extends BaseTestIteratingXLS {
excludes.put("clusterfuzz-testcase-minimized-POIHSSFFuzzer-5786329142919168.xls", RecordFormatException.class);
excludes.put("clusterfuzz-testcase-minimized-POIHSSFFuzzer-5889658057523200.xls", IndexOutOfBoundsException.class);
excludes.put("clusterfuzz-testcase-minimized-POIHSSFFuzzer-5175219985448960.xls", RecordFormatException.class);
excludes.put("clusterfuzz-testcase-minimized-POIHSSFFuzzer-6137883240824832.xls", RecordFormatException.class);

return excludes;
}


BIN
test-data/spreadsheet/clusterfuzz-testcase-minimized-POIHSSFFuzzer-6137883240824832.xls View File


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


Loading…
Cancel
Save