Browse Source

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

Fixes https://oss-fuzz.com/testcase-detail/5265527465181184

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1912277 13f79535-47bb-0310-9956-ffa450edef68
tags/REL_5_2_4
Dominik Stadler 8 months ago
parent
commit
4b70989156

+ 3
- 1
poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFGraphicFrame.java View File

@@ -54,8 +54,10 @@ public final class XSSFGraphicFrame extends XSSFShape {
protected XSSFGraphicFrame(XSSFDrawing drawing, CTGraphicalObjectFrame ctGraphicFrame) {
this.drawing = drawing; // protected field on XSSFShape
this.graphicFrame = ctGraphicFrame;

// TODO: there may be a better way to delegate this
CTGraphicalObjectData graphicData = graphicFrame.getGraphic().getGraphicData();
CTGraphicalObjectData graphicData = graphicFrame.getGraphic() == null ?
null : graphicFrame.getGraphic().getGraphicData();
if (graphicData != null) {
NodeList nodes = graphicData.getDomNode().getChildNodes();
for (int i = 0; i < nodes.getLength(); i++) {

BIN
test-data/spreadsheet/clusterfuzz-testcase-minimized-POIXSSFFuzzer-5265527465181184.xlsx View File


Loading…
Cancel
Save