pdfbox-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ueen...@yahoo.com.INVALID
Subject Re: [jira] [Commented] (PDFBOX-2477) NPE in DomXmpParser.createProperty
Date Mon, 03 Nov 2014 19:16:24 GMT

Sent from my BlackBerry wireless device from MTN

-----Original Message-----
From: "ASF subversion and git services (JIRA)" <jira@apache.org>
Date: Mon, 3 Nov 2014 19:15:34 
To: <dev@pdfbox.apache.org>
Reply-To: dev@pdfbox.apache.org
Subject: [jira] [Commented] (PDFBOX-2477) NPE in DomXmpParser.createProperty


    [ https://issues.apache.org/jira/browse/PDFBOX-2477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14194920#comment-14194920
] 

ASF subversion and git services commented on PDFBOX-2477:
---------------------------------------------------------

Commit 1636418 from [~tilman] in branch 'pdfbox/branches/1.8'
[ https://svn.apache.org/r1636418 ]

PDFBOX-2477: avoid NPE in ResourceRef with no child elements

> 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