diff options
author | Dominik Stadler <centic@apache.org> | 2023-10-07 22:12:35 +0000 |
---|---|---|
committer | Dominik Stadler <centic@apache.org> | 2023-10-07 22:12:35 +0000 |
commit | eb11f3324f6fc7f156839db24a85c21016f6003c (patch) | |
tree | fb7e1b9c60785479b81209ec918ae3e2ddb32a95 | |
parent | 50b4da40b8fc9db8a1c13f76af0693e17ad7e549 (diff) | |
download | poi-eb11f3324f6fc7f156839db24a85c21016f6003c.tar.gz poi-eb11f3324f6fc7f156839db24a85c21016f6003c.zip |
Bug 66425: Avoid Exceptions found via oss-fuzz
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
-rw-r--r-- | poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/section/geometry/LineTo.java | 4 | ||||
-rw-r--r-- | test-data/diagram/clusterfuzz-testcase-minimized-POIVisioFuzzer-5981064948219904.vsdx | bin | 0 -> 86540 bytes | |||
-rw-r--r-- | test-data/spreadsheet/stress.xls | bin | 57344 -> 57344 bytes |
3 files changed, 2 insertions, 2 deletions
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/section/geometry/LineTo.java b/poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/section/geometry/LineTo.java index 808080920b..61140377e6 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/section/geometry/LineTo.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/section/geometry/LineTo.java @@ -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 Binary files differnew file mode 100644 index 0000000000..6737dea0c9 --- /dev/null +++ b/test-data/diagram/clusterfuzz-testcase-minimized-POIVisioFuzzer-5981064948219904.vsdx diff --git a/test-data/spreadsheet/stress.xls b/test-data/spreadsheet/stress.xls Binary files differindex 50e923e810..ce88487bdb 100644 --- a/test-data/spreadsheet/stress.xls +++ b/test-data/spreadsheet/stress.xls |