mirror of https://github.com/apache/poi.git
Bug 66425: Avoid a ClassCastException found via oss-fuzz
We try to avoid throwing ClassCastException, 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@1912140 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5d073e3586
commit
aad473eaca
|
@ -312,11 +312,11 @@ public class XWPFDocument extends POIXMLDocument implements Document, IBody {
|
|||
for (RelationPart rp : getRelationParts()) {
|
||||
POIXMLDocumentPart p = rp.getDocumentPart();
|
||||
String relation = rp.getRelationship().getRelationshipType();
|
||||
if (relation.equals(XWPFRelation.FOOTNOTE.getRelation())) {
|
||||
if (relation.equals(XWPFRelation.FOOTNOTE.getRelation()) && p instanceof XWPFFootnotes) {
|
||||
this.footnotes = (XWPFFootnotes) p;
|
||||
this.footnotes.onDocumentRead();
|
||||
this.footnotes.setIdManager(footnoteIdManager);
|
||||
} else if (relation.equals(XWPFRelation.ENDNOTE.getRelation())) {
|
||||
} else if (relation.equals(XWPFRelation.ENDNOTE.getRelation()) && p instanceof XWPFEndnotes) {
|
||||
this.endnotes = (XWPFEndnotes) p;
|
||||
this.endnotes.onDocumentRead();
|
||||
this.endnotes.setIdManager(footnoteIdManager);
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue