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

Potential NPE in PDMarkedContent#getMCID()

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.10, 1.8.11, 2.0.0
    • Fix Version/s: 1.8.11, 2.0.0
    • Component/s: PDModel
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: