]> source.dussan.org Git - poi.git/commitdiff
Bug 66425: Avoid exceptions found via poi-fuzz
authorDominik Stadler <centic@apache.org>
Sun, 14 Jul 2024 11:26:43 +0000 (11:26 +0000)
committerDominik Stadler <centic@apache.org>
Sun, 14 Jul 2024 11:26:43 +0000 (11:26 +0000)
Prevent a NullPointerException

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=70273

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

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

index ef363efc8ef0ed5cdb56aeef1fc447e2504cdbf6..11621ded350642149be6fd378a4e1a8e938ebd0f 100644 (file)
@@ -73,9 +73,9 @@ public abstract class XDGFSheet {
 
             for (SectionType section: sheet.getSectionArray()) {
                 String name = section.getN();
-                if (name.equals("Geometry")) {
+                if ("Geometry".equals(name)) {
                     _geometry.put(section.getIX(), new GeometrySection(section, this));
-                } else if (name.equals("Character")) {
+                } else if ("Character".equals(name)) {
                     _character = new CharacterSection(section, this);
                 } else {
                     _sections.put(name, XDGFSection.load(section, this));
diff --git a/test-data/diagram/clusterfuzz-testcase-minimized-POIVisioFuzzer-5026516754628608.vsdx b/test-data/diagram/clusterfuzz-testcase-minimized-POIVisioFuzzer-5026516754628608.vsdx
new file mode 100644 (file)
index 0000000..4cbf5eb
Binary files /dev/null and b/test-data/diagram/clusterfuzz-testcase-minimized-POIVisioFuzzer-5026516754628608.vsdx differ
index 04046bd635862ed77db5acd57fe09fbd8a12826d..3baca6559b3895997aa86ed0d870a5773f371563 100644 (file)
Binary files a/test-data/spreadsheet/stress.xls and b/test-data/spreadsheet/stress.xls differ