Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-5163

Stack overflow when reading a corrupt dictionary

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.23, 3.0.0 PDFBox
    • 2.0.24, 3.0.0 PDFBox
    • Parsing
    • None

    Description

      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:

      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)
      

      Attachments

        1. crash_stack_overflow_sample.pdf
          22 kB
          Andreas Lehmkühler

        Issue Links

          Activity

            People

              lehmi Andreas Lehmkühler
              lehmi Andreas Lehmkühler
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: