Tilman Hausherr created PDFBOX-6132:
---------------------------------------
Summary: 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: 3.0.6 PDFBox, 2.0.35
Reporter: Tilman Hausherr
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]