diff --git a/poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/XDGFPages.java b/poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/XDGFPages.java index ab6077449ec..4e50cad5971 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/XDGFPages.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/XDGFPages.java @@ -25,6 +25,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more import com.microsoft.schemas.office.visio.x2012.main.PageType; import com.microsoft.schemas.office.visio.x2012.main.PagesDocument; import com.microsoft.schemas.office.visio.x2012.main.PagesType; +import com.microsoft.schemas.office.visio.x2012.main.RelType; + import org.apache.poi.ooxml.POIXMLDocumentPart; import org.apache.poi.ooxml.POIXMLException; import org.apache.poi.openxml4j.opc.PackagePart; @@ -68,7 +70,12 @@ protected void onDocumentRead() { // this iteration is ordered by page number for (PageType pageSettings: _pagesObject.getPageArray()) { - String relId = pageSettings.getRel().getId(); + RelType rel = pageSettings.getRel(); + if (rel == null) { + throw new IllegalStateException("Could not read relation for page settings"); + } + + String relId = rel.getId(); POIXMLDocumentPart pageContentsPart = getRelationById(relId); if (pageContentsPart == null) diff --git a/test-data/diagram/clusterfuzz-testcase-minimized-POIVisioFuzzer-6358126418591744.vsdx b/test-data/diagram/clusterfuzz-testcase-minimized-POIVisioFuzzer-6358126418591744.vsdx new file mode 100644 index 00000000000..041c8fb140f Binary files /dev/null and b/test-data/diagram/clusterfuzz-testcase-minimized-POIVisioFuzzer-6358126418591744.vsdx differ diff --git a/test-data/spreadsheet/stress.xls b/test-data/spreadsheet/stress.xls index d06a4e4d5b7..50e923e810d 100644 Binary files a/test-data/spreadsheet/stress.xls and b/test-data/spreadsheet/stress.xls differ