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

        Tom Field created issue -
        Tom Field made changes -
        Field Original Value New Value
        Attachment customer_dispute_form.pdf [ 12511460 ]
        Timo Boehme made changes -
        Assignee Timo Boehme [ tboehme ]
        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.
        Timo Boehme made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Fix Version/s 1.7.0 [ 12316940 ]
        Resolution Fixed [ 1 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Closed Closed
        15h 17m 1 Timo Boehme 23/Jan/12 15:35

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development