aboutsummaryrefslogtreecommitdiffstats
path: root/poi/src/main
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2023-12-30 19:39:42 +0000
committerDominik Stadler <centic@apache.org>2023-12-30 19:39:42 +0000
commita27029d1af6600a73a18faf9675809006a9a515f (patch)
tree6b5d0a252184b89d82ffc569f68686cda514c54e /poi/src/main
parentd54c8f16e69e43ffb9af932997c4a2918ebad66e (diff)
downloadpoi-a27029d1af6600a73a18faf9675809006a9a515f.tar.gz
poi-a27029d1af6600a73a18faf9675809006a9a515f.zip
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
Diffstat (limited to 'poi/src/main')
-rw-r--r--poi/src/main/java/org/apache/poi/hssf/record/FeatRecord.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/poi/src/main/java/org/apache/poi/hssf/record/FeatRecord.java b/poi/src/main/java/org/apache/poi/hssf/record/FeatRecord.java
index a434658ba4..86e2fc8f57 100644
--- a/poi/src/main/java/org/apache/poi/hssf/record/FeatRecord.java
+++ b/poi/src/main/java/org/apache/poi/hssf/record/FeatRecord.java
@@ -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() {