2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-12-22 10:58:58 +00:00

Merge pull request #1226 from m-holger/fuzz5

In QPDFOutlineObjectHelper detect loops in direct children
This commit is contained in:
m-holger 2024-06-30 01:50:16 +01:00 committed by GitHub
commit 09492eea06
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 7 additions and 2 deletions

View File

@ -120,6 +120,7 @@ set(CORPUS_OTHER
68915.fuzz
69857.fuzz
69913.fuzz
69969.fuzz
)
set(CORPUS_DIR ${CMAKE_CURRENT_BINARY_DIR}/qpdf_corpus)

BIN
fuzz/qpdf_extra/69969.fuzz Normal file

Binary file not shown.

View File

@ -173,8 +173,11 @@ FuzzHelper::doChecks()
{
// Get as much coverage as possible in parts of the library that
// might benefit from fuzzing.
std::cout << "starting testWrite\n";
testWrite();
std::cout << "\nstarting testPages\n\n";
testPages();
std::cout << "\nstarting testOutlines\n\n";
testOutlines();
}

View File

@ -21,7 +21,7 @@ my @fuzzers = (
['pngpredictor' => 1],
['runlength' => 6],
['tiffpredictor' => 2],
['qpdf' => 62], # increment when adding new files
['qpdf' => 63], # increment when adding new files
);
my $n_tests = 0;

View File

@ -23,8 +23,9 @@ QPDFOutlineObjectHelper::QPDFOutlineObjectHelper(
return;
}
QPDFObjGen::set children;
QPDFObjectHandle cur = oh.getKey("/First");
while (!cur.isNull()) {
while (!cur.isNull() && children.add(cur)) {
QPDFOutlineObjectHelper new_ooh(cur, dh, 1 + depth);
new_ooh.m->parent = std::make_shared<QPDFOutlineObjectHelper>(*this);
m->kids.push_back(new_ooh);