[
https://issues.apache.org/jira/browse/PDFBOX-5163?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17319924#comment-17319924
]
Andreas Lehmkühler commented on PDFBOX-5163:
--------------------------------------------
The pdf is corrupted and the cause for the stack overflow is a broken
dictionary. PDFBox tries to read as much as possible and runs into a infinite
loop which ends up in stack overflow after a short time. The trunk isn't
affected as the parser stops working with an error message when verifying the
root dictionary which is broken as well.
> Stack overflow when reading a corrupt dictionary
> ------------------------------------------------
>
> Key: PDFBOX-5163
> URL: https://issues.apache.org/jira/browse/PDFBOX-5163
> Project: PDFBox
> Issue Type: Bug
> Components: Parsing
> Affects Versions: 2.0.23
> Reporter: Andreas Lehmkühler
> Assignee: Andreas Lehmkühler
> Priority: Major
> Fix For: 2.0.24
>
> Attachments: crash_stack_overflow_sample.pdf
>
>
> Richard Smith/Chaoyuan Peng reported an issue with the current version
> 2.0.23. When parsing a carefully handcrafted pdf the following exception
> occurs and PDFBox crashes:
> {code}
> java.lang.StackOverflowError: null
> java.util.WeakHashMap.eq(Unknown Source)
> java.util.WeakHashMap.get(Unknown Source)
> java.util.Collections$SynchronizedMap.get(Unknown Source)
> org.apache.pdfbox.debugger.ui.LogDialog.log(LogDialog.java:143)
> org.apache.pdfbox.debugger.ui.DebugLog.warn(DebugLog.java:156)
> org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:933)
>
> org.apache.pdfbox.pdfparser.BaseParser.parseCOSDictionaryValue(BaseParser.java:154)
>
> org.apache.pdfbox.pdfparser.BaseParser.parseCOSDictionaryNameValuePair(BaseParser.java:283)
>
> org.apache.pdfbox.pdfparser.BaseParser.parseCOSDictionary(BaseParser.java:216)
> org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:859)
> org.apache.pdfbox.pdfparser.COSParser.parseFileObject(COSParser.java:917)
>
> org.apache.pdfbox.pdfparser.COSParser.parseObjectDynamically(COSParser.java:886)
>
> org.apache.pdfbox.pdfparser.COSParser.parseObjectDynamically(COSParser.java:806)
> org.apache.pdfbox.pdfparser.COSParser.getLength(COSParser.java:1060)
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]