]> source.dussan.org Git - poi.git/commitdiff
Bug 66425: Avoid exceptions found via poi-fuzz
authorDominik Stadler <centic@apache.org>
Sun, 28 Jul 2024 11:02:18 +0000 (11:02 +0000)
committerDominik Stadler <centic@apache.org>
Sun, 28 Jul 2024 11:02:18 +0000 (11:02 +0000)
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

poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/section/geometry/MoveTo.java
test-data/diagram/clusterfuzz-testcase-minimized-POIVisioFuzzer-5313947071217664.vsdx [new file with mode: 0644]
test-data/spreadsheet/stress.xls

index c324d916a4d7005b53b75a994d6fa0fbd38750b5..36bf1aec2336c9911030870316021985789b3907 100644 (file)
@@ -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 (file)
index 0000000..37e003b
Binary files /dev/null and b/test-data/diagram/clusterfuzz-testcase-minimized-POIVisioFuzzer-5313947071217664.vsdx differ
index f4efb868ba6659e9bef0fdaf023cc6e784365896..1667a30b74d1d1acbe5e8551e4ea30a98ceff955 100644 (file)
Binary files a/test-data/spreadsheet/stress.xls and b/test-data/spreadsheet/stress.xls differ