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

Potential NPE in PDMarkedContent#getMCID()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.10, 1.8.11, 2.0.0
    • 1.8.11, 2.0.0
    • PDModel
    • None

    Description

      I do not have a test case, but this method in PDMarkedContent is obviously wrong:

          public int getMCID()
          {
              return this.getProperties() == null ? null :
                  this.getProperties().getInt(COSName.MCID);
          }
      

      if getProperties() is null, the method tries to convert null Integer value to an int. I believe the intention was rather:

      ...
              return this.getProperties() == null ? 0 :
      ...
      

      Attachments

        Activity

          People

            tilman Tilman Hausherr
            pslabycz Petr Slaby
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: