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

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

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

PDFBOX-2985: avoid potential NPE, as pointed out by Petr Slaby

> Potential NPE in PDMarkedContent#getMCID()
> ------------------------------------------
>
>                 Key: PDFBOX-2985
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2985
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>    Affects Versions: 1.8.10, 1.8.11, 2.0.0
>            Reporter: Petr Slaby
>
> I do not have a test case, but this method in PDMarkedContent is obviously 
> wrong:
> {noformat}
>     public int getMCID()
>     {
>         return this.getProperties() == null ? null :
>             this.getProperties().getInt(COSName.MCID);
>     }
> {noformat}
> if getProperties() is null, the method tries to convert null Integer value to 
> an int. I believe the intention was rather:
> {noformat}
> ...
>         return this.getProperties() == null ? 0 :
> ...
> {noformat}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to