pdfbox-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tilman Hausherr (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (PDFBOX-4452) ClassCastException in PDPageTree
Date Thu, 31 Jan 2019 07:38:00 GMT

     [ https://issues.apache.org/jira/browse/PDFBOX-4452?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Tilman Hausherr resolved PDFBOX-4452.
-------------------------------------
       Resolution: Fixed
         Assignee: Tilman Hausherr
    Fix Version/s: 3.0.0 PDFBox
                   2.0.14

Thanks!

> ClassCastException in PDPageTree
> --------------------------------
>
>                 Key: PDFBOX-4452
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4452
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 2.0.13
>            Reporter: Robin Schimpf
>            Assignee: Tilman Hausherr
>            Priority: Minor
>             Fix For: 2.0.14, 3.0.0 PDFBox
>
>         Attachments: ClassCastException COSInteger instead of COSDictionary, ClassCastException
COSString instead of COSDictionary
>
>
> Fuzzing PDF merging with JQF triggered an ClassCastException. The attached file is merged
with itself.
> {code:java}
> java.lang.ClassCastException: org.apache.pdfbox.cos.COSInteger cannot be cast to org.apache.pdfbox.cos.COSDictionary
> 	at org.apache.pdfbox.pdmodel.PDPageTree.getKids(PDPageTree.java:144)
> 	at org.apache.pdfbox.pdmodel.PDPageTree.access$200(PDPageTree.java:38)
> 	at org.apache.pdfbox.pdmodel.PDPageTree$PageIterator.enqueueKids(PDPageTree.java:166)
> 	at org.apache.pdfbox.pdmodel.PDPageTree$PageIterator.<init>(PDPageTree.java:159)
> 	at org.apache.pdfbox.pdmodel.PDPageTree$PageIterator.<init>(PDPageTree.java:153)
> 	at org.apache.pdfbox.pdmodel.PDPageTree.iterator(PDPageTree.java:123)
> 	at org.apache.pdfbox.multipdf.PDFMergerUtility.appendDocument(PDFMergerUtility.java:737)
> 	at org.apache.pdfbox.multipdf.PDFMergerUtility.legacyMergeDocuments(PDFMergerUtility.java:390)
> 	at org.apache.pdfbox.multipdf.PDFMergerUtility.mergeDocuments(PDFMergerUtility.java:276)
> ...
> {code}
> The Code used for fuzzing is
> {code:java}
> try (OutputStream out = new ByteArrayOutputStream()) {
>     PDFMergerUtility pdfMergerUtility = new PDFMergerUtility();
>     pdfMergerUtility.addSource(file);
>     pdfMergerUtility.addSource(file);
>     pdfMergerUtility.setDestinationStream(out);
>     pdfMergerUtility.mergeDocuments(MemoryUsageSetting.setupMainMemoryOnly());
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org


Mime
View raw message