[
https://issues.apache.org/jira/browse/PDFBOX-6132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18047401#comment-18047401
]
Tilman Hausherr commented on PDFBOX-6132:
-----------------------------------------
I'm wondering whether such a PDF could exist or not?
> NullPointerException in `COSDocument.getLinearizedDictionary()` when
> xrefTable contains null key
> ------------------------------------------------------------------------------------------------
>
> Key: PDFBOX-6132
> URL: https://issues.apache.org/jira/browse/PDFBOX-6132
> Project: PDFBox
> Issue Type: Bug
> Affects Versions: 2.0.35, 3.0.6 PDFBox
> Reporter: Tilman Hausherr
> Priority: Major
> Fix For: 2.0.36, 3.0.7 PDFBox, 4.0.0
>
>
> Posted by Haoran Yan on the users mailing list:
> NullPointerException (NPE) in COSDocument. Specifically, when a
> cross-reference table (xrefTable) containing a null key is added via
> addXRefTable(), calling getLinearizedDictionary() results in an unhandled NPE
> at line 219 of COSDocument.java.
> Reproduce:
> Run the following test case:
> {code:java}
> public class TestClass {
> @Test
> public void test() {
> COSDocument document = new COSDocument();
> Map<COSObjectKey, Long> xrefTable = new HashMap<>();
> xrefTable.put(null, 10L);
> document.addXRefTable(xrefTable);
> document.getLinearizedDictionary();
> }
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]