PDFBox
  1. PDFBox
  2. PDFBOX-1212

NullPointerException in SecurityHandler.addDictionaryAndSubDictionary(SecurityHandler.java:185)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6.0
    • Fix Version/s: 1.7.0
    • Component/s: Parsing
    • Labels:
      None

      Description

      NullPointerException in SecurityHandler.addDictionaryAndSubDictionary(SecurityHandler.java:185)

      The attached pdf causes a null pointer in my environment possible security encryption issue?

      java.io.IOException:
      at org.apache.tika.parser.ParsingReader.read(ParsingReader.java:260)
      ...
      Caused by: org.apache.tika.exception.TikaException: Unexpected RuntimeException from org.apache.tika.parser.pdf.PDFParser@335ac93d
      at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:244)
      at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:242)
      at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:120)
      at org.apache.tika.parser.ParsingReader$ParsingTask.run(ParsingReader.java:221)
      ... 1 more
      Caused by: java.lang.NullPointerException
      at org.apache.pdfbox.pdmodel.encryption.SecurityHandler.addDictionaryAndSubDictionary(SecurityHandler.java:185)

      Note I incorrectly logged this in TIKA as https://issues.apache.org/jira/browse/TIKA-848 so could that one be resolved when this one is? thanks.

        Activity

        Hide
        Timo Boehme added a comment -

        fixed in rev. 1234846; o.a.p.pdmodel.encryption.SecurityHandler scans for dictionaries which might be signature dictionaries because the strings of 'Content' field should not be changed; the problem arises if the dictionary traversal points to objects in object streams because these are not available at this point, thus we have to check for null values and stop traversal here;

        Since (byte range) signature dictionaries with string valued Content field won't be in object streams, adding the traversal stop does not produce another problem.

        Show
        Timo Boehme added a comment - fixed in rev. 1234846; o.a.p.pdmodel.encryption.SecurityHandler scans for dictionaries which might be signature dictionaries because the strings of 'Content' field should not be changed; the problem arises if the dictionary traversal points to objects in object streams because these are not available at this point, thus we have to check for null values and stop traversal here; Since (byte range) signature dictionaries with string valued Content field won't be in object streams, adding the traversal stop does not produce another problem.

          People

          • Assignee:
            Timo Boehme
            Reporter:
            Tom Field
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development