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

Infiniteloop BaseParser.java:1010

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.3
    • 1.8.4, 2.0.0
    • Parsing
    • None

    Description

      infinite loop at org.apache.pdfbox.pdfparser.BaseParser.parseCOSHexString(BaseParser.java:1010)

      private final COSString parseCOSHexString() throws IOException
      {
      ...
      // read till the closing bracket was found
      do

      { c = pdfSource.read(); }

      while ( c != '>' );
      ...

      if pdfSource.read() returns EOF, the loop never terminates;

      Testcase:
      PDDocument doc = PDDocument.load (new FileInputStream("..."));

      2 real world pdf-files that cause the loop could be attached; do not know if their PDF is completely valid, but at least they are displayed via Preview in MacOSX.

      Attachments

        1. dls.pdf
          50 kB
          Manfred Schauer
        2. rsag.pdf
          65 kB
          Manfred Schauer

        Activity

          People

            Unassigned Unassigned
            maschau Manfred Schauer
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: