mirror of
https://github.com/qpdf/qpdf.git
synced 2024-11-09 14:50:58 +00:00
In QPDFOutlineObjectHelper detect loops in direct children
Also, add diagnostic messages in qpdf_fuzzer and additional fuzz test case.
This commit is contained in:
parent
c93b149b4d
commit
0a081e1f09
@ -120,6 +120,7 @@ set(CORPUS_OTHER
|
|||||||
68915.fuzz
|
68915.fuzz
|
||||||
69857.fuzz
|
69857.fuzz
|
||||||
69913.fuzz
|
69913.fuzz
|
||||||
|
69969.fuzz
|
||||||
)
|
)
|
||||||
|
|
||||||
set(CORPUS_DIR ${CMAKE_CURRENT_BINARY_DIR}/qpdf_corpus)
|
set(CORPUS_DIR ${CMAKE_CURRENT_BINARY_DIR}/qpdf_corpus)
|
||||||
|
BIN
fuzz/qpdf_extra/69969.fuzz
Normal file
BIN
fuzz/qpdf_extra/69969.fuzz
Normal file
Binary file not shown.
@ -173,8 +173,11 @@ FuzzHelper::doChecks()
|
|||||||
{
|
{
|
||||||
// Get as much coverage as possible in parts of the library that
|
// Get as much coverage as possible in parts of the library that
|
||||||
// might benefit from fuzzing.
|
// might benefit from fuzzing.
|
||||||
|
std::cout << "starting testWrite\n";
|
||||||
testWrite();
|
testWrite();
|
||||||
|
std::cout << "\nstarting testPages\n\n";
|
||||||
testPages();
|
testPages();
|
||||||
|
std::cout << "\nstarting testOutlines\n\n";
|
||||||
testOutlines();
|
testOutlines();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ my @fuzzers = (
|
|||||||
['pngpredictor' => 1],
|
['pngpredictor' => 1],
|
||||||
['runlength' => 6],
|
['runlength' => 6],
|
||||||
['tiffpredictor' => 2],
|
['tiffpredictor' => 2],
|
||||||
['qpdf' => 62], # increment when adding new files
|
['qpdf' => 63], # increment when adding new files
|
||||||
);
|
);
|
||||||
|
|
||||||
my $n_tests = 0;
|
my $n_tests = 0;
|
||||||
|
@ -23,8 +23,9 @@ QPDFOutlineObjectHelper::QPDFOutlineObjectHelper(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QPDFObjGen::set children;
|
||||||
QPDFObjectHandle cur = oh.getKey("/First");
|
QPDFObjectHandle cur = oh.getKey("/First");
|
||||||
while (!cur.isNull()) {
|
while (!cur.isNull() && children.add(cur)) {
|
||||||
QPDFOutlineObjectHelper new_ooh(cur, dh, 1 + depth);
|
QPDFOutlineObjectHelper new_ooh(cur, dh, 1 + depth);
|
||||||
new_ooh.m->parent = std::make_shared<QPDFOutlineObjectHelper>(*this);
|
new_ooh.m->parent = std::make_shared<QPDFOutlineObjectHelper>(*this);
|
||||||
m->kids.push_back(new_ooh);
|
m->kids.push_back(new_ooh);
|
||||||
|
Loading…
Reference in New Issue
Block a user