pdfbox-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Lehmkühler (JIRA) <j...@apache.org>
Subject [jira] [Resolved] (PDFBOX-4349) ClassCastException in COSParser
Date Sun, 21 Oct 2018 20:21:00 GMT

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

Andreas Lehmkühler resolved PDFBOX-4349.
----------------------------------------
       Resolution: Fixed
    Fix Version/s: 3.0.0 PDFBox
                   2.0.13

I've added 3 convenience methods to COSDictionary to make it easier to check for expected
objects:
- getCOSObject
- getCOSDictionary
- getCOSArray
This should reduce the instanceof checks, at least in those case where the type of the expected
value is clear
I've deprecated/removed 3 other convenience methods from COSDictionary which doesn't make
that much sense. Those were using more than 2 keys for the values to caller is looking for.

Thanks

> ClassCastException in COSParser
> -------------------------------
>
>                 Key: PDFBOX-4349
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4349
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 2.0.12
>            Reporter: Robin Schimpf
>            Assignee: Andreas Lehmkühler
>            Priority: Minor
>             Fix For: 2.0.13, 3.0.0 PDFBox
>
>         Attachments: ClassCastException COSParser#parseTrailerValuesDynamically
>
>
> Fuzzing PDF loading with [JQF|https://github.com/rohanpadhye/jqf] triggered an ClassCastException.
> {code:java}
> java.lang.ClassCastException: org.apache.pdfbox.cos.COSInteger cannot be cast to org.apache.pdfbox.cos.COSObject
> 	at org.apache.pdfbox.pdfparser.COSParser.parseTrailerValuesDynamically(COSParser.java:2841)
> 	at org.apache.pdfbox.pdfparser.PDFParser.initialParse(PDFParser.java:173)
> 	at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:220)
> 	at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1160)
> 	at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1057)
>     ...
> {code}
> The Code used for fuzzing is
> {code:java}
> PDDocument.load(inputStream)
> {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