diff options
author | Dominik Stadler <centic@apache.org> | 2023-09-06 10:38:51 +0000 |
---|---|---|
committer | Dominik Stadler <centic@apache.org> | 2023-09-06 10:38:51 +0000 |
commit | b801711afea9d452312a0e23be50bf64d59ea281 (patch) | |
tree | 69756513b75bc3ee473487969e892107e62e15c8 /poi-ooxml | |
parent | 04ae3b4441efde2c1b2c3f75d15fef6b6f1b0549 (diff) | |
download | poi-b801711afea9d452312a0e23be50bf64d59ea281.tar.gz poi-b801711afea9d452312a0e23be50bf64d59ea281.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=62059
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1912127 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-ooxml')
-rw-r--r-- | poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTableStyle.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTableStyle.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTableStyle.java index cbbdef9c4a..652c377e1a 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTableStyle.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTableStyle.java @@ -84,6 +84,9 @@ public class XSSFTableStyle implements TableStyle { } for (CTTableStyleElement element : tableStyle.getTableStyleElementList()) { + if (element.getType() == null) { + throw new IllegalArgumentException("Did not have a type in table-style " + element); + } TableStyleType type = TableStyleType.valueOf(element.getType().toString()); DifferentialStyleProvider dstyle = null; if (element.isSetDxfId()) { |