aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2024-07-28 11:02:18 +0000
committerDominik Stadler <centic@apache.org>2024-07-28 11:02:18 +0000
commit0559accac420546df618823758d928f390eaab20 (patch)
tree1d82160d1f11b763fe619a486bdee516e2807bc4
parentc05eebf415c9273eb9f874fa7480aed815700ce4 (diff)
downloadpoi-0559accac420546df618823758d928f390eaab20.tar.gz
poi-0559accac420546df618823758d928f390eaab20.zip
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
-rw-r--r--poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/section/geometry/MoveTo.java4
-rw-r--r--test-data/diagram/clusterfuzz-testcase-minimized-POIVisioFuzzer-5313947071217664.vsdxbin0 -> 238145 bytes
-rw-r--r--test-data/spreadsheet/stress.xlsbin110080 -> 70656 bytes
3 files changed, 2 insertions, 2 deletions
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
--- /dev/null
+++ b/test-data/diagram/clusterfuzz-testcase-minimized-POIVisioFuzzer-5313947071217664.vsdx
Binary files differ
diff --git a/test-data/spreadsheet/stress.xls b/test-data/spreadsheet/stress.xls
index f4efb868ba..1667a30b74 100644
--- a/test-data/spreadsheet/stress.xls
+++ b/test-data/spreadsheet/stress.xls
Binary files differ