Michael McCandless created TIKA-986:
---------------------------------------

             Summary: NullPointerException trying to parse detached .pk7s 
signature
                 Key: TIKA-986
                 URL: https://issues.apache.org/jira/browse/TIKA-986
             Project: Tika
          Issue Type: Bug
            Reporter: Michael McCandless
            Assignee: Michael McCandless
             Fix For: 1.3


Our Pkcs7Parser tries to pull the signed content out and then parses
that, but if the signature is detached then there is no content (we
get null return from CMSSignedDataParser.getSignedContent) and we hit
NPE:

{noformat}
Exception in thread "main" org.apache.tika.exception.TikaException: Unexpected 
RuntimeException from org.apache.tika.parser.crypto.Pkcs7Parser@5545757a
        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.cli.TikaCLI$OutputType.process(TikaCLI.java:138)
        at org.apache.tika.cli.TikaCLI.process(TikaCLI.java:399)
        at org.apache.tika.cli.TikaCLI.main(TikaCLI.java:111)
Caused by: java.lang.NullPointerException
        at org.apache.tika.parser.crypto.Pkcs7Parser.parse(Pkcs7Parser.java:64)
        at 
org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:242)
        ... 5 more
{noformat}

I think fix is trivial: if we get null return then throw a
TikaException saying there's nothing to extract.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to