Fuzz introspector: flate_fuzzer
For issues and ideas: https://github.com/ossf/fuzz-introspector/issues

Fuzz blockers

The followings are the branches where fuzzer fails to bypass.

Unique non-covered Complexity Unique Reachable Complexities Unique Reachable Functions All non-covered Complexity All Reachable Complexity Function Name Function Callsite Blocked Branch
38 38 1 :

['inflateInit_']

370 935 Pl_Flate::handleData(unsignedcharconst*,unsignedlong,int) call site: 00000 /src/qpdf/libqpdf/Pl_Flate.cc:151
21 21 1 :

['crc32']

579 630 deflate call site: 00098 /src/zlib/deflate.c:1160
21 21 1 :

['crc32']

21 21 read_buf call site: 00106 /src/zlib/deflate.c:227
14 35 3 :

['deflateEnd', 'inflateEnd', '__clang_call_terminate']

14 35 Pl_Flate::Members::~Members() call site: 00000 /src/qpdf/libqpdf/Pl_Flate.cc:55
12 12 1 :

['inflateEnd']

30 81 Pl_Flate::finish() call site: 00000 /src/qpdf/libqpdf/Pl_Flate.cc:240
12 12 8 :

['__cxa_guard_acquire', 'std::__1::basic_string , std::__1::allocator >::~basic_string()', 'std::__1::basic_string , std::__1::allocator >::basic_string[abi:ne180100]()', 'QUtil::get_env(std::__1::basic_string , std::__1::allocator > const&, std::__1::basic_string , std::__1::allocator >*)', 'bool std::__1::operator==[abi:ne180100] , std::__1::allocator >(std::__1::basic_string , std::__1::allocator > const&, char const*)', '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B8ne180100ILi0EEEPKc', '__cxa_guard_abort', '__cxa_guard_release']

12 12 Pl_Flate::zopfli_enabled() call site: 00000 /src/qpdf/libqpdf/Pl_Flate.cc:352
8 8 4 :

['__cxa_throw', '__cxa_allocate_exception', 'std::runtime_error::runtime_error(char const*)', '__cxa_free_exception']

8 8 Pl_Flate::Members::Members(unsignedlong,Pl_Flate::action_e) call site: 00000 /src/qpdf/libqpdf/Pl_Flate.cc:34
8 8 13 :

['_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B8ne180100ILi0EEEPKc', '__cxa_throw', 'std::__1::basic_string , std::__1::allocator >::~basic_string()', 'std::runtime_error::runtime_error(std::__1::basic_string , std::__1::allocator > const&)', 'std::__1::unique_ptr >::operator->[abi:ne180100]() const', 'std::__1::basic_string , std::__1::allocator > std::__1::operator+[abi:ne180100] , std::__1::allocator >(std::__1::basic_string , std::__1::allocator >&&, char const*)', 'std::__1::to_string(int)', 'std::__1::basic_string , std::__1::allocator >::operator+=[abi:ne180100](char const*)', '__cxa_free_exception', 'std::__1::basic_string , std::__1::allocator > std::__1::operator+[abi:ne180100] , std::__1::allocator >(std::__1::basic_string , std::__1::allocator >&&, std::__1::basic_string , std::__1::allocator >&&)', 'std::__1::basic_string , std::__1::allocator >::operator+=[abi:ne180100](std::__1::basic_string , std::__1::allocator > const&)', '__cxa_allocate_exception', 'std::__1::basic_string , std::__1::allocator > std::__1::operator+[abi:ne180100] , std::__1::allocator >(std::__1::basic_string , std::__1::allocator > const&, char const*)']

8 8 Pl_Flate::checkError(charconst*,int) call site: 00000 /src/qpdf/libqpdf/Pl_Flate.cc:272
7 14 2 :

['_tr_align', '_tr_stored_block']

7 38 deflate call site: 00143 /src/zlib/deflate.c:1211
2 2 1 :

['Pl_Flate::finish_zopfli()']

20 24 Pl_Flate::finish() call site: 00000 /src/qpdf/libqpdf/Pl_Flate.cc:231
0 21 1 :

['deflateEnd']

0 21 deflateInit2_ call site: 00038 /src/zlib/deflate.c:499
0 0 None 747 869 deflate call site: 00079 /src/zlib/deflate.c:1009

Fuzzer calltree

0 LLVMFuzzerTestOneInput [function] [call site] 00000
1 FuzzHelper::FuzzHelper(unsigned char const*, unsigned long) [function] [call site] 00001
1 FuzzHelper::run() [function] [call site] 00002
2 FuzzHelper::doChecks() [function] [call site] 00003
3 Pl_Discard::Pl_Discard() [function] [call site] 00004
4 Pipeline::Pipeline(char const*, Pipeline*) [function] [call site] 00005
3 Pl_Flate::Pl_Flate(char const*, Pipeline*, Pl_Flate::action_e, unsigned int) [function] [call site] 00006
4 Pipeline::Pipeline(char const*, Pipeline*) [function] [call site] 00007
4 unsigned long QIntC::to_size<unsigned int>(unsigned int const&) [function] [call site] 00008
5 QIntC::IntConverter<unsigned int, unsigned long, false, false>::convert(unsigned int const&) [function] [call site] 00009
6 QIntC::IntConverter<unsigned int, unsigned long, false, false>::error(unsigned int) [function] [call site] 00010
7 __cxa_allocate_exception [call site] 00011
7 std::__1::basic_ostringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >::str[abi:ne180100]() const & [function] [call site] 00012
8 std::__1::basic_stringbuf<char, std::__1::char_traits<char>, std::__1::allocator<char> >::str[abi:ne180100]() const & [function] [call site] 00013
7 std::range_error::range_error[abi:ne180100](std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) [function] [call site] 00014
8 std::runtime_error::runtime_error(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) [call site] 00015
7 __cxa_throw [call site] 00016
7 __cxa_free_exception [call site] 00017
4 __cxa_allocate_exception [call site] 00018
4 std::logic_error::logic_error(char const*) [call site] 00019
4 __cxa_throw [call site] 00020
4 __cxa_free_exception [call site] 00021
4 Pipeline::~Pipeline() [function] [call site] 00022
3 Pl_Flate::write(unsigned char const*, unsigned long) [function] [call site] 00023
4 __cxa_allocate_exception [call site] 00024
4 std::logic_error::logic_error(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) [call site] 00025
4 __cxa_throw [call site] 00026
4 __cxa_free_exception [call site] 00027
4 Pl_Flate::handleData(unsigned char const*, unsigned long, int) [function] [call site] 00028
5 __cxa_allocate_exception [call site] 00029
5 std::runtime_error::runtime_error(char const*) [call site] 00030
5 __cxa_throw [call site] 00031
5 std::runtime_error::~runtime_error() [call site] 00032
5 __cxa_free_exception [call site] 00033
5 unsigned int QIntC::to_uint<unsigned long>(unsigned long const&) [function] [call site] 00034
6 QIntC::IntConverter<unsigned long, unsigned int, false, false>::convert(unsigned long const&) [function] [call site] 00035
7 QIntC::IntConverter<unsigned long, unsigned int, false, false>::error(unsigned long) [function] [call site] 00036
5 deflateInit_ [function] [call site] 00037
6 deflateInit2_ [function] [call site] 00038
7 deflateEnd [function] [call site] 00039
8 deflateStateCheck [function] [call site] 00040
7 deflateReset [function] [call site] 00041
8 deflateResetKeep [function] [call site] 00042
9 deflateStateCheck [function] [call site] 00043
9 crc32 [function] [call site] 00044
10 crc32_z [function] [call site] 00045
11 crc_word [function] [call site] 00046
11 crc_word [function] [call site] 00047
11 crc_word [function] [call site] 00048
11 crc_word [function] [call site] 00049
11 crc_word [function] [call site] 00050
11 byte_swap [function] [call site] 00051
11 crc_word_big [function] [call site] 00052
11 crc_word_big [function] [call site] 00053
11 crc_word_big [function] [call site] 00054
11 crc_word_big [function] [call site] 00055
11 crc_word_big [function] [call site] 00056
11 byte_swap [function] [call site] 00057
9 _tr_init [function] [call site] 00060
10 tr_static_init [function] [call site] 00061
10 init_block [function] [call site] 00062
5 inflateInit_ [function] [call site] 00064
6 inflateInit2_ [function] [call site] 00065
7 inflateReset2 [function] [call site] 00066
8 inflateStateCheck [function] [call site] 00067
8 inflateReset [function] [call site] 00068
9 inflateStateCheck [function] [call site] 00069
9 inflateResetKeep [function] [call site] 00070
10 inflateStateCheck [function] [call site] 00071
5 Pl_Flate::checkError(char const*, int) [function] [call site] 00072
6 __cxa_allocate_exception [call site] 00073
6 std::runtime_error::runtime_error(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) [call site] 00074
6 __cxa_throw [call site] 00075
6 __cxa_free_exception [call site] 00076
5 deflate [function] [call site] 00077
6 deflateStateCheck [function] [call site] 00078
6 flush_pending [function] [call site] 00079
7 _tr_flush_bits [function] [call site] 00080
6 putShortMSB [function] [call site] 00082
6 putShortMSB [function] [call site] 00083
6 putShortMSB [function] [call site] 00084
6 flush_pending [function] [call site] 00086
6 flush_pending [function] [call site] 00088
6 flush_pending [function] [call site] 00091
6 flush_pending [function] [call site] 00094
6 flush_pending [function] [call site] 00097
6 flush_pending [function] [call site] 00099
6 flush_pending [function] [call site] 00101
6 deflate_stored [function] [call site] 00102
7 _tr_stored_block [function] [call site] 00103
8 bi_windup [function] [call site] 00104
7 flush_pending [function] [call site] 00105
7 _tr_stored_block [function] [call site] 00110
7 flush_pending [function] [call site] 00111
6 deflate_huff [function] [call site] 00112
7 fill_window [function] [call site] 00113
7 _tr_flush_block [function] [call site] 00116
8 detect_data_type [function] [call site] 00117
8 build_tree [function] [call site] 00118
9 pqdownheap [function] [call site] 00119
9 pqdownheap [function] [call site] 00120
9 pqdownheap [function] [call site] 00121
9 gen_bitlen [function] [call site] 00122
9 gen_codes [function] [call site] 00123
10 bi_reverse [function] [call site] 00124
8 build_tree [function] [call site] 00125
8 build_bl_tree [function] [call site] 00126
9 scan_tree [function] [call site] 00127
9 scan_tree [function] [call site] 00128
9 build_tree [function] [call site] 00129
8 _tr_stored_block [function] [call site] 00130
8 compress_block [function] [call site] 00131
8 send_all_trees [function] [call site] 00132
8 compress_block [function] [call site] 00135
8 init_block [function] [call site] 00136
8 bi_windup [function] [call site] 00137
7 flush_pending [function] [call site] 00138
7 _tr_flush_block [function] [call site] 00139
7 flush_pending [function] [call site] 00140
7 _tr_flush_block [function] [call site] 00141
7 flush_pending [function] [call site] 00142
6 deflate_rle [function] [call site] 00143
7 fill_window [function] [call site] 00144
7 _tr_flush_block [function] [call site] 00145
7 flush_pending [function] [call site] 00146
7 _tr_flush_block [function] [call site] 00147
7 flush_pending [function] [call site] 00148
7 _tr_flush_block [function] [call site] 00149
7 flush_pending [function] [call site] 00150
6 _tr_stored_block [function] [call site] 00153
6 flush_pending [function] [call site] 00154
6 putShortMSB [function] [call site] 00155
6 putShortMSB [function] [call site] 00156
6 flush_pending [function] [call site] 00157
5 strcmp [call site] 00182
5 Pl_Flate::warn(char const*, int) [function] [call site] 00183
5 unsigned long QIntC::to_ulong<unsigned long>(unsigned long const&) [function] [call site] 00184
6 QIntC::IntConverter<unsigned long, unsigned long, false, false>::convert(unsigned long const&) [function] [call site] 00185
7 QIntC::IntConverter<unsigned long, unsigned long, false, false>::error(unsigned long) [function] [call site] 00186
5 __cxa_allocate_exception [call site] 00187
5 std::runtime_error::runtime_error(char const*) [call site] 00188
5 __cxa_throw [call site] 00189
5 std::runtime_error::~runtime_error() [call site] 00190
5 __cxa_free_exception [call site] 00191
5 Pipeline::next() const [function] [call site] 00192
5 unsigned int QIntC::to_uint<unsigned long>(unsigned long const&) [function] [call site] 00193
5 Pl_Flate::checkError(char const*, int) [function] [call site] 00194
3 Pl_Flate::finish() [function] [call site] 00195
4 __cxa_allocate_exception [call site] 00196
4 std::runtime_error::runtime_error(char const*) [call site] 00197
4 __cxa_throw [call site] 00198
4 std::runtime_error::~runtime_error() [call site] 00199
4 __cxa_free_exception [call site] 00200
4 Pl_Flate::finish_zopfli() [function] [call site] 00201
4 __cxa_begin_catch [call site] 00202
4 Pipeline::next() const [function] [call site] 00203
4 Pl_Flate::handleData(unsigned char const*, unsigned long, int) [function] [call site] 00204
4 deflateEnd [function] [call site] 00205
4 inflateEnd [function] [call site] 00206
5 inflateStateCheck [function] [call site] 00207
4 Pl_Flate::checkError(char const*, int) [function] [call site] 00208
4 __cxa_begin_catch [call site] 00209
4 __cxa_end_catch [call site] 00210
4 __cxa_allocate_exception [call site] 00211
4 std::runtime_error::runtime_error(char const*) [call site] 00212
4 __cxa_throw [call site] 00213
4 __cxa_free_exception [call site] 00214
4 __cxa_end_catch [call site] 00215
4 Pipeline::next() const [function] [call site] 00216
4 __clang_call_terminate [call site] 00217
5 __cxa_begin_catch [call site] 00218
3 Pl_Flate::~Pl_Flate() [function] [call site] 00219
4 Pipeline::~Pipeline() [function] [call site] 00220
3 Pl_Discard::~Pl_Discard() [function] [call site] 00221
4 Pipeline::~Pipeline() [function] [call site] 00222
2 __cxa_begin_catch [call site] 00223
2 __cxa_end_catch [call site] 00224
2 __clang_call_terminate [call site] 00225