You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Adam Nichols (JIRA)" <ji...@apache.org> on 2010/06/02 00:07:40 UTC

[jira] Created: (PDFBOX-737) Fix potential NullPointer exception in PDPageNode

Fix potential NullPointer exception in PDPageNode
-------------------------------------------------

                 Key: PDFBOX-737
                 URL: https://issues.apache.org/jira/browse/PDFBOX-737
             Project: PDFBox
          Issue Type: Bug
          Components: Parsing
    Affects Versions: 1.1.0, 1.0.0, 0.8.0-incubator, 0.7.3, 0.7.2, 0.7.1, 0.7.0
         Environment: Windows Vista 32-bit, Java 1.5, HEAD tag of PDFBox
            Reporter: Adam Nichols
             Fix For: 1.2.0


getAllKids(List result, COSDictionary page, boolean recurse) throws a NullPointerException when page.getDictionaryObject( COSName.KIDS ) returns null.  I have a PDF where this actually happens but I can not provide it due to the confidential information it contains.  I confirmed that once I added the null check that the code worked as expected (the documents I was merging were visible, the page count was correct, etc.).  Patch will be attached momentarily.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PDFBOX-737) Fix potential NullPointer exception in PDPageNode

Posted by "Andreas Lehmkühler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PDFBOX-737?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12874593#action_12874593 ] 

Andreas Lehmkühler commented on PDFBOX-737:
-------------------------------------------

Before we include your patch I've one question: Isn't your document well structered or do we have a parser issue? Following the pdf reference the Kids entry in the dictionary is required and not optional. Does your document contain such an entry or is it missing?

> Fix potential NullPointer exception in PDPageNode
> -------------------------------------------------
>
>                 Key: PDFBOX-737
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-737
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Parsing
>    Affects Versions: 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.8.0-incubator, 1.0.0, 1.1.0
>         Environment: Windows Vista 32-bit, Java 1.5, HEAD tag of PDFBox
>            Reporter: Adam Nichols
>             Fix For: 1.2.0
>
>         Attachments: PDFBOX-737.patch
>
>
> getAllKids(List result, COSDictionary page, boolean recurse) throws a NullPointerException when page.getDictionaryObject( COSName.KIDS ) returns null.  I have a PDF where this actually happens but I can not provide it due to the confidential information it contains.  I confirmed that once I added the null check that the code worked as expected (the documents I was merging were visible, the page count was correct, etc.).  Patch will be attached momentarily.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (PDFBOX-737) Fix potential NullPointer exception in PDPageNode

Posted by "Andreas Lehmkühler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PDFBOX-737?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Lehmkühler resolved PDFBOX-737.
---------------------------------------

    Resolution: Fixed

I've added the patch with version 955842. I've made a small improvement by adding a log statement.

Thanks to Adam for the contribution.

> Fix potential NullPointer exception in PDPageNode
> -------------------------------------------------
>
>                 Key: PDFBOX-737
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-737
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Parsing
>    Affects Versions: 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.8.0-incubator, 1.0.0, 1.1.0
>         Environment: Windows Vista 32-bit, Java 1.5, HEAD tag of PDFBox
>            Reporter: Adam Nichols
>             Fix For: 1.2.0
>
>         Attachments: PDFBOX-737.patch
>
>
> getAllKids(List result, COSDictionary page, boolean recurse) throws a NullPointerException when page.getDictionaryObject( COSName.KIDS ) returns null.  I have a PDF where this actually happens but I can not provide it due to the confidential information it contains.  I confirmed that once I added the null check that the code worked as expected (the documents I was merging were visible, the page count was correct, etc.).  Patch will be attached momentarily.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PDFBOX-737) Fix potential NullPointer exception in PDPageNode

Posted by "Adam Nichols (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PDFBOX-737?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12874615#action_12874615 ] 

Adam Nichols commented on PDFBOX-737:
-------------------------------------

I believe the issue was that it was reading an object where the same ID appeared twice.  Once it looked like a normal page, and the other time it looked like a document outline.  I'm not sure if having multiple objects with the same ID is valid or not (I suspect that it is out of spec), but I've found that it happens rather often when PDFs are merged as some programs seems to just concatenate one PDF after another.

> Fix potential NullPointer exception in PDPageNode
> -------------------------------------------------
>
>                 Key: PDFBOX-737
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-737
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Parsing
>    Affects Versions: 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.8.0-incubator, 1.0.0, 1.1.0
>         Environment: Windows Vista 32-bit, Java 1.5, HEAD tag of PDFBox
>            Reporter: Adam Nichols
>             Fix For: 1.2.0
>
>         Attachments: PDFBOX-737.patch
>
>
> getAllKids(List result, COSDictionary page, boolean recurse) throws a NullPointerException when page.getDictionaryObject( COSName.KIDS ) returns null.  I have a PDF where this actually happens but I can not provide it due to the confidential information it contains.  I confirmed that once I added the null check that the code worked as expected (the documents I was merging were visible, the page count was correct, etc.).  Patch will be attached momentarily.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PDFBOX-737) Fix potential NullPointer exception in PDPageNode

Posted by "Adam Nichols (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PDFBOX-737?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Adam Nichols updated PDFBOX-737:
--------------------------------

    Attachment: PDFBOX-737.patch

> Fix potential NullPointer exception in PDPageNode
> -------------------------------------------------
>
>                 Key: PDFBOX-737
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-737
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Parsing
>    Affects Versions: 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.8.0-incubator, 1.0.0, 1.1.0
>         Environment: Windows Vista 32-bit, Java 1.5, HEAD tag of PDFBox
>            Reporter: Adam Nichols
>             Fix For: 1.2.0
>
>         Attachments: PDFBOX-737.patch
>
>
> getAllKids(List result, COSDictionary page, boolean recurse) throws a NullPointerException when page.getDictionaryObject( COSName.KIDS ) returns null.  I have a PDF where this actually happens but I can not provide it due to the confidential information it contains.  I confirmed that once I added the null check that the code worked as expected (the documents I was merging were visible, the page count was correct, etc.).  Patch will be attached momentarily.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.