Browse Source

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

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1911615 13f79535-47bb-0310-9956-ffa450edef68
tags/REL_5_2_4
Dominik Stadler 9 months ago
parent
commit
733d3d10ea

+ 1
- 1
poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackagePartName.java View File

@@ -201,7 +201,7 @@ public final class PackagePartName implements Comparable<PackagePartName> {
}

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]: "

BIN
test-data/spreadsheet/clusterfuzz-testcase-minimized-XLSX2CSVFuzzer-5636439151607808.xlsx View File


BIN
test-data/spreadsheet/stress.xls View File


Loading…
Cancel
Save