[
https://issues.apache.org/jira/browse/PDFBOX-4333?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16643819#comment-16643819
]
ASF subversion and git services commented on PDFBOX-4333:
---------------------------------------------------------
Commit 1843317 from [email protected] in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1843317 ]
PDFBOX-4333: Reduce the total number of break and continue statements in this
loop for SonarQube
> ClassCastException when loading PDF
> -----------------------------------
>
> Key: PDFBOX-4333
> URL: https://issues.apache.org/jira/browse/PDFBOX-4333
> Project: PDFBox
> Issue Type: Bug
> Components: Parsing
> Affects Versions: 2.0.12
> Reporter: Robin Schimpf
> Assignee: Tilman Hausherr
> Priority: Minor
> Fix For: 2.0.13, 3.0.0 PDFBox
>
> Attachments: ClassCastException COSArray instead of COSObject,
> ClassCastException COSBoolean instead of COSObject, ClassCastException
> COSFloat instead of COSObject, ClassCastException COSInteger instead of
> COSObject, ClassCastException COSName instead of COSObject,
> ClassCastException COSNull instead of COSObject, ClassCastException COSString
> instead of COSObject
>
>
> Fuzzing PDF loading with [JQF|https://github.com/rohanpadhye/jqf] triggered a
> ClassCastException. All attached files trigger the exception for a different
> class but are basically the same.
> {code:java}
> org.apache.pdfbox.cos.COSArray cannot be cast to
> org.apache.pdfbox.cos.COSObject
> java.lang.ClassCastException: org.apache.pdfbox.cos.COSArray cannot be cast
> to org.apache.pdfbox.cos.COSObject
> at
> org.apache.pdfbox.pdfparser.COSParser.checkPagesDictionary(COSParser.java:2337)
> at org.apache.pdfbox.pdfparser.COSParser.checkPages(COSParser.java:2321)
> at org.apache.pdfbox.pdfparser.PDFParser.initialParse(PDFParser.java:193)
> 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}
> Throwing an Exception is ok since no other PDF reader I tried is able to load
> the files. But it should not be an ClassCastException.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]