Author: centic Date: Tue Aug 22 14:22:06 2023 New Revision: 1911842 URL: http://svn.apache.org/viewvc?rev=1911842&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=61644 Added: poi/trunk/test-data/document/clusterfuzz-testcase-minimized-POIXWPFFuzzer-5569740188549120.docx (with props) Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFAbstractFootnotesEndnotes.java Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFAbstractFootnotesEndnotes.java URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFAbstractFootnotesEndnotes.java?rev=1911842&r1=1911841&r2=1911842&view=diff ============================================================================== --- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFAbstractFootnotesEndnotes.java (original) +++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFAbstractFootnotesEndnotes.java Tue Aug 22 14:22:06 2023 @@ -57,8 +57,10 @@ public abstract class XWPFAbstractFootno public XWPFAbstractFootnoteEndnote getFootnoteById(int id) { for (XWPFAbstractFootnoteEndnote note : listFootnote) { - if (note.getCTFtnEdn().getId().intValue() == id) + if (note.getCTFtnEdn().getId() != null && + note.getCTFtnEdn().getId().intValue() == id) { return note; + } } return null; } Added: poi/trunk/test-data/document/clusterfuzz-testcase-minimized-POIXWPFFuzzer-5569740188549120.docx URL: http://svn.apache.org/viewvc/poi/trunk/test-data/document/clusterfuzz-testcase-minimized-POIXWPFFuzzer-5569740188549120.docx?rev=1911842&view=auto ============================================================================== Binary file - no diff available. Propchange: poi/trunk/test-data/document/clusterfuzz-testcase-minimized-POIXWPFFuzzer-5569740188549120.docx ------------------------------------------------------------------------------ --- svn:mime-type (added) +++ svn:mime-type Tue Aug 22 14:22:06 2023 @@ -0,0 +1 @@ +application/vnd.openxmlformats-officedocument.wordprocessingml.document --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
