summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorm-holger <m-holger@kubitscheck.org>2023-08-25 13:25:06 +0200
committerm-holger <m-holger@kubitscheck.org>2023-08-25 13:25:06 +0200
commit6574dc5c030f866d560dc43cc7a10263ebc71e27 (patch)
treeea7d253c356faf0ad98886c2e9b3c08eebc930e8
parent34491c612d59b414cdeea47170d880a7f0783766 (diff)
downloadqpdf-6574dc5c030f866d560dc43cc7a10263ebc71e27.tar.zst
Store indirect nulls in QPDF_Dictionary
-rw-r--r--libqpdf/QPDF_Dictionary.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/libqpdf/QPDF_Dictionary.cc b/libqpdf/QPDF_Dictionary.cc
index df83632c..942e6d9e 100644
--- a/libqpdf/QPDF_Dictionary.cc
+++ b/libqpdf/QPDF_Dictionary.cc
@@ -122,7 +122,9 @@ void
QPDF_Dictionary::replaceKey(std::string const& key, QPDFObjectHandle value)
{
if (value.isNull() && !value.isIndirect()) {
- // The PDF spec doesn't distinguish between keys with null values and missing keys.
+ // The PDF spec doesn't distinguish between keys with null values and missing keys. Allow
+ // indirect nulls which are equivalent to a dangling reference, which is permitted by the
+ // spec.
removeKey(key);
} else {
// add or replace value