Author: centic
Date: Sat Aug 12 14:53:58 2023
New Revision: 1911615

URL: http://svn.apache.org/viewvc?rev=1911615&view=rev
Log:
Bug 66425: Avoid a NullPointerException found via oss-fuzz

We try to avoid throwing NullPointerException, 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=61390

Added:
    
poi/trunk/test-data/spreadsheet/clusterfuzz-testcase-minimized-XLSX2CSVFuzzer-5636439151607808.xlsx
Modified:
    
poi/trunk/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackagePartName.java
    poi/trunk/test-data/spreadsheet/stress.xls

Modified: 
poi/trunk/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackagePartName.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackagePartName.java?rev=1911615&r1=1911614&r2=1911615&view=diff
==============================================================================
--- 
poi/trunk/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackagePartName.java
 (original)
+++ 
poi/trunk/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackagePartName.java
 Sat Aug 12 14:53:58 2023
@@ -201,7 +201,7 @@ public final class PackagePartName imple
         }
 
         String uriPath = partURI.getPath();
-        if (uriPath.length() == 0
+        if (uriPath == null || uriPath.isEmpty()
                 || ((uriPath.length() == 1) && (uriPath.charAt(0) == 
PackagingURIHelper.FORWARD_SLASH_CHAR))) {
             throw new InvalidFormatException(
                     "A part name shall not be empty [M1.1]: "

Added: 
poi/trunk/test-data/spreadsheet/clusterfuzz-testcase-minimized-XLSX2CSVFuzzer-5636439151607808.xlsx
URL: 
http://svn.apache.org/viewvc/poi/trunk/test-data/spreadsheet/clusterfuzz-testcase-minimized-XLSX2CSVFuzzer-5636439151607808.xlsx?rev=1911615&view=auto
==============================================================================
Binary files 
poi/trunk/test-data/spreadsheet/clusterfuzz-testcase-minimized-XLSX2CSVFuzzer-5636439151607808.xlsx
 (added) and 
poi/trunk/test-data/spreadsheet/clusterfuzz-testcase-minimized-XLSX2CSVFuzzer-5636439151607808.xlsx
 Sat Aug 12 14:53:58 2023 differ

Modified: poi/trunk/test-data/spreadsheet/stress.xls
URL: 
http://svn.apache.org/viewvc/poi/trunk/test-data/spreadsheet/stress.xls?rev=1911615&r1=1911614&r2=1911615&view=diff
==============================================================================
Binary files - no diff available.



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to