This is an automated email from the ASF dual-hosted git repository. centic9 pushed a commit to branch add_fuzzing_readme_and_fix_npe in repository https://gitbox.apache.org/repos/asf/poi.git
commit f89abbabc5221548abda658fe319dc927121b19f Author: Dominik Stadler <[email protected]> AuthorDate: Wed Oct 21 17:44:20 2026 +0200 Fuzzing: Adjust how we detect if an NPE is casued by commons-compress There will be NPEs detected by fuzzing in commons-compress until a new release is done, so we need to detect and exclude those for now to keep fuzzing other code-areas --- poi-fuzz/src/main/java/org/apache/poi/fuzz/POIFileHandlerFuzzer.java | 2 +- poi-fuzz/src/main/java/org/apache/poi/fuzz/POIVisioFuzzer.java | 2 +- poi-fuzz/src/main/java/org/apache/poi/fuzz/POIXSSFFuzzer.java | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/poi-fuzz/src/main/java/org/apache/poi/fuzz/POIFileHandlerFuzzer.java b/poi-fuzz/src/main/java/org/apache/poi/fuzz/POIFileHandlerFuzzer.java index 2600d0a091..d96090ad7c 100644 --- a/poi-fuzz/src/main/java/org/apache/poi/fuzz/POIFileHandlerFuzzer.java +++ b/poi-fuzz/src/main/java/org/apache/poi/fuzz/POIFileHandlerFuzzer.java @@ -128,7 +128,7 @@ public class POIFileHandlerFuzzer { } } catch (NullPointerException e) { // can be removed when commons-compress is > 1.28.0 and changes from COMPRESS-598 are applied - if (!ExceptionUtils.getStackTrace(e).contains("ZipArchiveInputStream.read")) { + if (!ExceptionUtils.getStackTrace(e).contains("org.apache.commons.compress.archivers.zip.ZipArchiveInputStream.read")) { throw e; } } diff --git a/poi-fuzz/src/main/java/org/apache/poi/fuzz/POIVisioFuzzer.java b/poi-fuzz/src/main/java/org/apache/poi/fuzz/POIVisioFuzzer.java index e4db2f80c1..505b543b3e 100644 --- a/poi-fuzz/src/main/java/org/apache/poi/fuzz/POIVisioFuzzer.java +++ b/poi-fuzz/src/main/java/org/apache/poi/fuzz/POIVisioFuzzer.java @@ -44,7 +44,7 @@ public class POIVisioFuzzer { // expected here } catch (NullPointerException e) { // can be removed when commons-compress is > 1.28.0 and changes from COMPRESS-598 are applied - if (!ExceptionUtils.getStackTrace(e).contains("ZipArchiveInputStream.read")) { + if (!ExceptionUtils.getStackTrace(e).contains("org.apache.commons.compress.archivers.zip.ZipArchiveInputStream.read")) { throw e; } } diff --git a/poi-fuzz/src/main/java/org/apache/poi/fuzz/POIXSSFFuzzer.java b/poi-fuzz/src/main/java/org/apache/poi/fuzz/POIXSSFFuzzer.java index 51ddba5665..7b477e6473 100644 --- a/poi-fuzz/src/main/java/org/apache/poi/fuzz/POIXSSFFuzzer.java +++ b/poi-fuzz/src/main/java/org/apache/poi/fuzz/POIXSSFFuzzer.java @@ -21,6 +21,7 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import org.apache.commons.io.output.NullOutputStream; +import org.apache.commons.lang3.exception.ExceptionUtils; import org.apache.poi.ooxml.POIXMLException; import org.apache.poi.openxml4j.exceptions.OpenXML4JException; import org.apache.poi.openxml4j.exceptions.OpenXML4JRuntimeException; @@ -56,7 +57,8 @@ public class POIXSSFFuzzer { ArithmeticException e) { // expected } catch (NullPointerException e) { - if (!e.getMessage().startsWith("Cannot invoke \"java.io.InputStream.read(byte[], int, int)\"")) { + // can be removed when commons-compress is > 1.28.0 and changes from COMPRESS-598 are applied + if (!ExceptionUtils.getStackTrace(e).contains("org.apache.commons.compress.archivers.zip.ZipArchiveInputStream.read")) { throw e; } } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
