mirror of
https://github.com/apache/poi.git
synced 2026-02-27 20:40:08 +08:00
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 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1912139 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
24bf8c33f2
commit
5d073e3586
@ -205,6 +205,9 @@ public abstract class POIXMLRelation {
|
||||
PackageRelationship rel = it.next();
|
||||
PackagePartName relName = PackagingURIHelper.createPartName(rel.getTargetURI());
|
||||
PackagePart part = corePart.getPackage().getPart(relName);
|
||||
if (part == null) {
|
||||
throw new IllegalArgumentException("Could not read part " + relName + " from " + corePart);
|
||||
}
|
||||
return part.getInputStream();
|
||||
}
|
||||
LOGGER.atWarn().log("No part {} found", getDefaultFileName());
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user