]> source.dussan.org Git - poi.git/commitdiff
Bug 66425: Avoid exceptions found via poi-fuzz
authorDominik Stadler <centic@apache.org>
Fri, 27 Oct 2023 10:07:57 +0000 (10:07 +0000)
committerDominik Stadler <centic@apache.org>
Fri, 27 Oct 2023 10:07:57 +0000 (10:07 +0000)
Fix one expected exception-text which is different
on newer Java versions

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

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

poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTextParagraph.java
test-data/spreadsheet/clusterfuzz-testcase-minimized-POIXSSFFuzzer-6419366255919104.xlsx [new file with mode: 0644]

index f93c64474427a1d406a3a051468acf71c386f0d5..55e52db3d849358fe1a5d0461af40bf5b712f231 100644 (file)
@@ -836,7 +836,7 @@ public class XSSFTextParagraph implements Iterable<XSSFTextRun>{
     public ListAutoNumber getBulletAutoNumberScheme() {
         ParagraphPropertyFetcher<ListAutoNumber> fetcher = new ParagraphPropertyFetcher<ListAutoNumber>(getLevel()){
             public boolean fetch(CTTextParagraphProperties props){
-                if(props.isSetBuAutoNum()) {
+                if(props.isSetBuAutoNum() && props.getBuAutoNum().getType() != null) {
                     setValue(ListAutoNumber.values()[props.getBuAutoNum().getType().intValue() - 1]);
                     return true;
                 }
diff --git a/test-data/spreadsheet/clusterfuzz-testcase-minimized-POIXSSFFuzzer-6419366255919104.xlsx b/test-data/spreadsheet/clusterfuzz-testcase-minimized-POIXSSFFuzzer-6419366255919104.xlsx
new file mode 100644 (file)
index 0000000..2a3a0d7
Binary files /dev/null and b/test-data/spreadsheet/clusterfuzz-testcase-minimized-POIXSSFFuzzer-6419366255919104.xlsx differ