Author: centic
Date: Wed Aug 23 09:30:00 2023
New Revision: 1911863

URL: http://svn.apache.org/viewvc?rev=1911863&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=61520

Added:
    
poi/trunk/test-data/document/clusterfuzz-testcase-minimized-POIXWPFFuzzer-6442791109263360.docx
   (with props)
Modified:
    
poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java
    poi/trunk/test-data/spreadsheet/stress.xls

Modified: 
poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java?rev=1911863&r1=1911862&r2=1911863&view=diff
==============================================================================
--- 
poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java
 (original)
+++ 
poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java
 Wed Aug 23 09:30:00 2023
@@ -233,7 +233,7 @@ public class XWPFDocument extends POIXML
                 }
             }
             // Sort out headers and footers
-            if (doc.getDocument().getBody().getSectPr() != null) {
+            if (doc.getDocument().getBody() != null && 
doc.getDocument().getBody().getSectPr() != null) {
                 headerFooterPolicy = new XWPFHeaderFooterPolicy(this);
             }
 

Added: 
poi/trunk/test-data/document/clusterfuzz-testcase-minimized-POIXWPFFuzzer-6442791109263360.docx
URL: 
http://svn.apache.org/viewvc/poi/trunk/test-data/document/clusterfuzz-testcase-minimized-POIXWPFFuzzer-6442791109263360.docx?rev=1911863&view=auto
==============================================================================
Binary file - no diff available.

Propchange: 
poi/trunk/test-data/document/clusterfuzz-testcase-minimized-POIXWPFFuzzer-6442791109263360.docx
------------------------------------------------------------------------------
--- svn:mime-type (added)
+++ svn:mime-type Wed Aug 23 09:30:00 2023
@@ -0,0 +1 @@
+application/vnd.openxmlformats-officedocument.wordprocessingml.document

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



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

Reply via email to