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

EOFException parsing PDFs with invalid xref offsets

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.4
    • Fix Version/s: 2.0.5, 3.0.0 PDFBox
    • Component/s: Parsing
    • Labels:
      None

      Description

      ScratchFileBuffer does not allow seeking past the end of file. If the xref table claims an object offset past the end of file an IOException is incorrectly thrown.

      COSParser.checkObjectKeys() seeks to the offset claimed in the xref table and looks for a valid object number and generation number there.

      If there is an IOException while trying to READ in COSParser.checkObjectKeys(), the exception is caught and the parser falls back to brute force searching for objects offsets.

      The problem is that IOExceptions are not caught when attempting to SEEK to the offset claimed in the xref table. Solution: move the seek operation inside the try {} block.

        Attachments

          Activity

            People

            • Assignee:
              lehmi Andreas Lehmkühler
              Reporter:
              jesselong Jesse Long
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: