提交 1b88529d 编写于 作者: D Dominik Stadler

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=61644

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1911842 13f79535-47bb-0310-9956-ffa450edef68
上级 5a4193b1
...@@ -57,8 +57,10 @@ public abstract class XWPFAbstractFootnotesEndnotes extends POIXMLDocumentPart { ...@@ -57,8 +57,10 @@ public abstract class XWPFAbstractFootnotesEndnotes extends POIXMLDocumentPart {
public XWPFAbstractFootnoteEndnote getFootnoteById(int id) { public XWPFAbstractFootnoteEndnote getFootnoteById(int id) {
for (XWPFAbstractFootnoteEndnote note : listFootnote) { for (XWPFAbstractFootnoteEndnote note : listFootnote) {
if (note.getCTFtnEdn().getId().intValue() == id) if (note.getCTFtnEdn().getId() != null &&
note.getCTFtnEdn().getId().intValue() == id) {
return note; return note;
}
} }
return null; return null;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册