aboutsummaryrefslogtreecommitdiffstats
path: root/poi
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2023-09-17 14:38:24 +0000
committerDominik Stadler <centic@apache.org>2023-09-17 14:38:24 +0000
commit9e2ce70d2bbe6f1a1d982f280c42be7078b3e8be (patch)
tree8a33d7da3e29265cb90a57ab61ce40073dcf9065 /poi
parent4b520ff7c5859cf18ea7cc9a74524f381d4624c3 (diff)
downloadpoi-9e2ce70d2bbe6f1a1d982f280c42be7078b3e8be.tar.gz
poi-9e2ce70d2bbe6f1a1d982f280c42be7078b3e8be.zip
Bug 66425: Avoid NullPointerExceptions and ClassCastExceptions found via poi-fuzz
We try to avoid throwing NullPointerException and ClassCastExceptions, but it was possible to trigger them Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=62414 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=62442 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=62450 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1912365 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi')
-rw-r--r--poi/src/main/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionHeader.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/poi/src/main/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionHeader.java b/poi/src/main/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionHeader.java
index 78c289f5ea..3d08cf7fbf 100644
--- a/poi/src/main/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionHeader.java
+++ b/poi/src/main/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionHeader.java
@@ -61,7 +61,7 @@ public class AgileEncryptionHeader extends EncryptionHeader {
setFlags(0);
setSizeExtra(0);
setCspName(null);
- setBlockSize(keyData.getBlockSize());
+ setBlockSize(keyData.getBlockSize() == null ? 0 : keyData.getBlockSize());
setChainingMode(keyData.getCipherChaining());