pdfbox-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tilman Hausherr (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (PDFBOX-2477) NPE in DomXmpParser.createProperty
Date Mon, 03 Nov 2014 19:00:34 GMT

     [ https://issues.apache.org/jira/browse/PDFBOX-2477?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Tilman Hausherr updated PDFBOX-2477:
------------------------------------
    Attachment: gs-bugzilla692826.pdf

> NPE in DomXmpParser.createProperty
> ----------------------------------
>
>                 Key: PDFBOX-2477
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2477
>             Project: PDFBox
>          Issue Type: Bug
>          Components: XmpBox
>    Affects Versions: 1.8.7, 1.8.8, 2.0.0
>            Reporter: Tilman Hausherr
>            Assignee: Tilman Hausherr
>             Fix For: 1.8.8, 2.0.0
>
>         Attachments: gs-bugzilla692826.pdf
>
>
> I get this NPE with the attached file:
> {code}
> Exception in thread "main" java.lang.NullPointerException
> 	at org.apache.xmpbox.xml.DomXmpParser.createProperty(DomXmpParser.java:352)
> 	at org.apache.xmpbox.xml.DomXmpParser.parseDescriptionRoot(DomXmpParser.java:292)
> 	at org.apache.xmpbox.xml.DomXmpParser.parse(DomXmpParser.java:206)
> 	at org.apache.xmpbox.xml.DomXmpParser.parse(DomXmpParser.java:114)
> 	at org.apache.pdfbox.preflight.process.MetadataValidationProcess.validate(MetadataValidationProcess.java:67)
> 	at org.apache.pdfbox.preflight.utils.ContextHelper.callValidation(ContextHelper.java:73)
> 	at org.apache.pdfbox.preflight.utils.ContextHelper.validateElement(ContextHelper.java:88)
> 	at org.apache.pdfbox.preflight.PreflightDocument.validate(PreflightDocument.java:168)
> 	at org.apache.pdfbox.preflight.Validator_A1b.runSimple(Validator_A1b.java:161)
> 	at org.apache.pdfbox.preflight.Validator_A1b.main(Validator_A1b.java:126)
> {code}
> The cause is this:
> {code}
> <xapMM:DerivedFrom rdf:parseType="Resource"/>
> {code}
> According to the XMP spec, that part can have missing elements, i.e. it is not an error.
So I'll just add a null check.
> There are more potiential NPE risks in that code, however I prefer to get examples.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message