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

Hangup in COSFilterInputStream.nextRange

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.25
    • 2.0.26, 3.0.0 PDFBox
    • None
    • None

    Description

      On some broken PDFs call PDSignature.getSignedContent never returns.
      After exploring stacktrace I've found cycle in COSFilterInputStream.nextRange.

                  while (this.position < this.ranges[this.range][0])
                  {
                      long skipped = super.skip(this.ranges[this.range][0] - this.position);
                      this.position += skipped;
                  }
      

      Javadoc for skip says "The skip method may, for a variety ofreasons, end up skipping over some smaller number of bytes, possibly 0."
      So, when skip returns 0 this cycle became infinite.
      Tried in versions 2.0.25 and 3.0.0-RC1.

      Attachments

        Activity

          People

            tilman Tilman Hausherr
            ovoled Aleksej Kozlov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: