From: Dominik Stadler Date: Sun, 28 Jul 2024 11:02:18 +0000 (+0000) Subject: Bug 66425: Avoid exceptions found via poi-fuzz X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0559accac420546df618823758d928f390eaab20;p=poi.git Bug 66425: Avoid exceptions found via poi-fuzz Prevent a possible NullPointerException Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=70467 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1919562 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/section/geometry/MoveTo.java b/poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/section/geometry/MoveTo.java index c324d916a4..36bf1aec23 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/section/geometry/MoveTo.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/section/geometry/MoveTo.java @@ -48,9 +48,9 @@ public class MoveTo implements GeometryRow { for (CellType cell : row.getCellArray()) { String cellName = cell.getN(); - if (cellName.equals("X")) { + if ("X".equals(cellName)) { x = XDGFCell.parseDoubleValue(cell); - } else if (cellName.equals("Y")) { + } else if ("Y".equals(cellName)) { y = XDGFCell.parseDoubleValue(cell); } else { throw new POIXMLException("Invalid cell '" + cellName diff --git a/test-data/diagram/clusterfuzz-testcase-minimized-POIVisioFuzzer-5313947071217664.vsdx b/test-data/diagram/clusterfuzz-testcase-minimized-POIVisioFuzzer-5313947071217664.vsdx new file mode 100644 index 0000000000..37e003b9ca Binary files /dev/null and b/test-data/diagram/clusterfuzz-testcase-minimized-POIVisioFuzzer-5313947071217664.vsdx differ diff --git a/test-data/spreadsheet/stress.xls b/test-data/spreadsheet/stress.xls index f4efb868ba..1667a30b74 100644 Binary files a/test-data/spreadsheet/stress.xls and b/test-data/spreadsheet/stress.xls differ