aboutsummaryrefslogtreecommitdiffstats
path: root/poi-ooxml/src/main/java
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2024-07-14 11:27:02 +0000
committerDominik Stadler <centic@apache.org>2024-07-14 11:27:02 +0000
commit8be69305cac65b6f2b9016471bdd046edfc40182 (patch)
treebc1bf26cdd49a25bc34fb204d2723df66b4f4683 /poi-ooxml/src/main/java
parenta0421651334ce1344b6085274ab4a7284a266bf5 (diff)
downloadpoi-8be69305cac65b6f2b9016471bdd046edfc40182.tar.gz
poi-8be69305cac65b6f2b9016471bdd046edfc40182.zip
Bug 66425: Avoid exceptions found via poi-fuzz
Prevent a NullPointerException Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=66400 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1919216 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-ooxml/src/main/java')
-rw-r--r--poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFVMLDrawing.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFVMLDrawing.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFVMLDrawing.java
index 5d1932c908..475fcc7cc9 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFVMLDrawing.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFVMLDrawing.java
@@ -151,6 +151,11 @@ public final class XSSFVMLDrawing extends POIXMLDocumentPart {
" xmlns=\""+NS_SPREADSHEETML+"\"", "")
, xopt);
+ // ignore empty XML content in the stream which indicates severely broken parts in the workbook-file
+ if (root.getXml() == null) {
+ return;
+ }
+
try (XmlCursor cur = root.getXml().newCursor()) {
for (boolean found = cur.toFirstChild(); found; found = cur.toNextSibling()) {
XmlObject xo = cur.getObject();