]> source.dussan.org Git - poi.git/commitdiff
Bug 66425: Avoid Exceptions found via oss-fuzz
authorDominik Stadler <centic@apache.org>
Sat, 7 Oct 2023 22:12:35 +0000 (22:12 +0000)
committerDominik Stadler <centic@apache.org>
Sat, 7 Oct 2023 22:12:35 +0000 (22:12 +0000)
We try to avoid throwing NullPointerExceptions or endless allocations,
but it was possible to trigger one here with a specially
crafted input-file

Should fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=62745

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1912795 13f79535-47bb-0310-9956-ffa450edef68

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

index 808080920b997aaa76d3c535d46b671299ac0aea..61140377e6315019557fdd2645f508023012d7e6 100644 (file)
@@ -43,9 +43,9 @@ public class LineTo 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-5981064948219904.vsdx b/test-data/diagram/clusterfuzz-testcase-minimized-POIVisioFuzzer-5981064948219904.vsdx
new file mode 100644 (file)
index 0000000..6737dea
Binary files /dev/null and b/test-data/diagram/clusterfuzz-testcase-minimized-POIVisioFuzzer-5981064948219904.vsdx differ
index 50e923e810d017d375c34e5fc0bf460df4499adb..ce88487bdbf21ca5d361e6e6f78193a977874981 100644 (file)
Binary files a/test-data/spreadsheet/stress.xls and b/test-data/spreadsheet/stress.xls differ