Commit c2c1618e08f07a831a8bacff8d65aa75793d91d4
1 parent
2b6500ea
Add extra sanity check on pages tree
Reject non-dictionary Page and Pages objects. Also add additional qpdf_fuzzer test cases.
Showing
6 changed files
with
8 additions
and
1 deletions
fuzz/CMakeLists.txt
fuzz/qpdf_extra/4599089157701632.fuzz
0 โ 100644
No preview for this file type
fuzz/qpdf_extra/69977b.fuzz
0 โ 100644
No preview for this file type
fuzz/qpdf_extra/69977c.fuzz
0 โ 100644
No preview for this file type
fuzz/qtest/fuzz.test
libqpdf/QPDF_pages.cc
| ... | ... | @@ -98,6 +98,10 @@ QPDF::getAllPagesInternal( |
| 98 | 98 | int n = kids.getArrayNItems(); |
| 99 | 99 | for (int i = 0; i < n; ++i) { |
| 100 | 100 | auto kid = kids.getArrayItem(i); |
| 101 | + if (!kid.isDictionary()) { | |
| 102 | + kid.warnIfPossible("Pages tree includes non-dictionary object; removing"); | |
| 103 | + continue; | |
| 104 | + } | |
| 101 | 105 | if (kid.hasKey("/Kids")) { |
| 102 | 106 | getAllPagesInternal(kid, visited, seen, media_box); |
| 103 | 107 | } else { | ... | ... |