aboutsummaryrefslogtreecommitdiffstats
path: root/poi-ooxml
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2024-07-14 11:26:56 +0000
committerDominik Stadler <centic@apache.org>2024-07-14 11:26:56 +0000
commita0421651334ce1344b6085274ab4a7284a266bf5 (patch)
treeefd83aaaf3bede53389a3bfa9d8cdf052a414217 /poi-ooxml
parentfc17f113d8a14341bc753231877d0d9b3c312118 (diff)
downloadpoi-a0421651334ce1344b6085274ab4a7284a266bf5.tar.gz
poi-a0421651334ce1344b6085274ab4a7284a266bf5.zip
Bug 66425: Avoid exceptions found via poi-fuzz
Prevent a NullPointerException Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=68104 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1919215 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-ooxml')
-rw-r--r--poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/XDGFMasters.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/XDGFMasters.java b/poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/XDGFMasters.java
index 7bc97dd79f..315c5921b4 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/XDGFMasters.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/XDGFMasters.java
@@ -27,6 +27,8 @@ import java.util.Map;
import com.microsoft.schemas.office.visio.x2012.main.MasterType;
import com.microsoft.schemas.office.visio.x2012.main.MastersDocument;
import com.microsoft.schemas.office.visio.x2012.main.MastersType;
+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,10 @@ public class XDGFMasters extends XDGFXMLDocumentPart {
Map<String, MasterType> masterSettings = new HashMap<>();
for (MasterType master: _mastersObject.getMasterArray()) {
- masterSettings.put(master.getRel().getId(), master);
+ RelType rel = master.getRel();
+ if (rel != null) {
+ masterSettings.put(rel.getId(), master);
+ }
}
// create the masters
>110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192