Commit 09492eea0613a19c16546b526860bb8db56492e7
Committed by
GitHub
Merge pull request #1226 from m-holger/fuzz5
In QPDFOutlineObjectHelper detect loops in direct children
Showing
5 changed files
with
7 additions
and
2 deletions
fuzz/CMakeLists.txt
fuzz/qpdf_extra/69969.fuzz
0 → 100644
No preview for this file type
fuzz/qpdf_fuzzer.cc
| ... | ... | @@ -173,8 +173,11 @@ FuzzHelper::doChecks() |
| 173 | 173 | { |
| 174 | 174 | // Get as much coverage as possible in parts of the library that |
| 175 | 175 | // might benefit from fuzzing. |
| 176 | + std::cout << "starting testWrite\n"; | |
| 176 | 177 | testWrite(); |
| 178 | + std::cout << "\nstarting testPages\n\n"; | |
| 177 | 179 | testPages(); |
| 180 | + std::cout << "\nstarting testOutlines\n\n"; | |
| 178 | 181 | testOutlines(); |
| 179 | 182 | } |
| 180 | 183 | ... | ... |
fuzz/qtest/fuzz.test
libqpdf/QPDFOutlineObjectHelper.cc
| ... | ... | @@ -23,8 +23,9 @@ QPDFOutlineObjectHelper::QPDFOutlineObjectHelper( |
| 23 | 23 | return; |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | + QPDFObjGen::set children; | |
| 26 | 27 | QPDFObjectHandle cur = oh.getKey("/First"); |
| 27 | - while (!cur.isNull()) { | |
| 28 | + while (!cur.isNull() && children.add(cur)) { | |
| 28 | 29 | QPDFOutlineObjectHelper new_ooh(cur, dh, 1 + depth); |
| 29 | 30 | new_ooh.m->parent = std::make_shared<QPDFOutlineObjectHelper>(*this); |
| 30 | 31 | m->kids.push_back(new_ooh); | ... | ... |