Commit baa2f2b44b9f2d830e1ec6bb018b670d08ac4867
Committed by
GitHub
Merge pull request #1533 from m-holger/fuzz
Fix `replaceKey` in `BaseDictionary`: update to use `null`/`indirect`…
Showing
4 changed files
with
3 additions
and
2 deletions
fuzz/CMakeLists.txt
| @@ -163,6 +163,7 @@ set(CORPUS_OTHER | @@ -163,6 +163,7 @@ set(CORPUS_OTHER | ||
| 163 | 440747125.fuzz | 163 | 440747125.fuzz |
| 164 | 4720043549327360.fuzz | 164 | 4720043549327360.fuzz |
| 165 | 5109284021272576.fuzz | 165 | 5109284021272576.fuzz |
| 166 | + 5828408539152384.fuzz | ||
| 166 | 6489005569146880.fuzz | 167 | 6489005569146880.fuzz |
| 167 | ) | 168 | ) |
| 168 | 169 |
fuzz/qpdf_extra/5828408539152384.fuzz
0 → 100644
No preview for this file type
fuzz/qtest/fuzz.test
| @@ -11,7 +11,7 @@ my $td = new TestDriver('fuzz'); | @@ -11,7 +11,7 @@ my $td = new TestDriver('fuzz'); | ||
| 11 | 11 | ||
| 12 | my $qpdf_corpus = $ENV{'QPDF_FUZZ_CORPUS'} || die "must set QPDF_FUZZ_CORPUS"; | 12 | my $qpdf_corpus = $ENV{'QPDF_FUZZ_CORPUS'} || die "must set QPDF_FUZZ_CORPUS"; |
| 13 | 13 | ||
| 14 | -my $n_qpdf_files = 101; # increment when adding new files | 14 | +my $n_qpdf_files = 102; # increment when adding new files |
| 15 | 15 | ||
| 16 | my @fuzzers = ( | 16 | my @fuzzers = ( |
| 17 | ['ascii85' => 1], | 17 | ['ascii85' => 1], |
libqpdf/QPDF_Dictionary.cc
| @@ -67,7 +67,7 @@ void | @@ -67,7 +67,7 @@ void | ||
| 67 | BaseDictionary::replaceKey(std::string const& key, QPDFObjectHandle value) | 67 | BaseDictionary::replaceKey(std::string const& key, QPDFObjectHandle value) |
| 68 | { | 68 | { |
| 69 | auto d = dict(); | 69 | auto d = dict(); |
| 70 | - if (value.isNull() && !value.isIndirect()) { | 70 | + if (value.null() && !value.indirect()) { |
| 71 | // The PDF spec doesn't distinguish between keys with null values and missing keys. | 71 | // The PDF spec doesn't distinguish between keys with null values and missing keys. |
| 72 | // Allow indirect nulls which are equivalent to a dangling reference, which is | 72 | // Allow indirect nulls which are equivalent to a dangling reference, which is |
| 73 | // permitted by the spec. | 73 | // permitted by the spec. |