Fuzz introspector: lzw_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
8 8 4 :

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

8 8 Pl_LZWDecoder::getFirstChar(unsignedint) call site: 00000 /src/qpdf/libqpdf/Pl_LZWDecoder.cc:86
8 8 4 :

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

8 8 Pl_LZWDecoder::addToTable(unsignedchar) call site: 00000 /src/qpdf/libqpdf/Pl_LZWDecoder.cc:111
0 0 None 0 0 Buffer::Members::Members(unsignedlong,unsignedchar*,bool) call site: 00000 /src/qpdf/libqpdf/Buffer.cc:30
0 0 None 0 0 Pl_LZWDecoder::Pl_LZWDecoder(charconst*,Pipeline*,bool) call site: 00000 /src/qpdf/libqpdf/Pl_LZWDecoder.cc:13

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_LZWDecoder::Pl_LZWDecoder(char const*, Pipeline*, bool) [function] [call site] 00006
4 Pipeline::Pipeline(char const*, Pipeline*) [function] [call site] 00007
4 __cxa_allocate_exception [call site] 00008
4 std::logic_error::logic_error(char const*) [call site] 00009
4 __cxa_throw [call site] 00010
4 __cxa_free_exception [call site] 00011
4 Pipeline::~Pipeline() [function] [call site] 00012
3 Pl_LZWDecoder::write(unsigned char const*, unsigned long) [function] [call site] 00013
4 Pl_LZWDecoder::sendNextCode() [function] [call site] 00014
5 Pl_LZWDecoder::handleCode(unsigned int) [function] [call site] 00015
6 QTC::TC(char const*, char const*, int) [function] [call site] 00016
6 unsigned int QIntC::to_uint<unsigned long>(unsigned long const&) [function] [call site] 00017
7 QIntC::IntConverter<unsigned long, unsigned int, false, false>::convert(unsigned long const&) [function] [call site] 00018
8 QIntC::IntConverter<unsigned long, unsigned int, false, false>::error(unsigned long) [function] [call site] 00019
9 __cxa_allocate_exception [call site] 00020
9 std::__1::basic_ostringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >::str[abi:ne180100]() const & [function] [call site] 00021
10 std::__1::basic_stringbuf<char, std::__1::char_traits<char>, std::__1::allocator<char> >::str[abi:ne180100]() const & [function] [call site] 00022
9 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] 00023
10 std::runtime_error::runtime_error(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) [call site] 00024
9 __cxa_throw [call site] 00025
9 __cxa_free_exception [call site] 00026
6 __cxa_allocate_exception [call site] 00027
6 std::runtime_error::runtime_error(char const*) [call site] 00028
6 __cxa_throw [call site] 00029
6 std::runtime_error::~runtime_error() [call site] 00030
6 __cxa_free_exception [call site] 00031
6 QTC::TC(char const*, char const*, int) [function] [call site] 00032
6 Pl_LZWDecoder::getFirstChar(unsigned int) [function] [call site] 00033
7 __cxa_allocate_exception [call site] 00034
7 std::runtime_error::runtime_error(char const*) [call site] 00035
7 __cxa_throw [call site] 00036
7 std::runtime_error::~runtime_error() [call site] 00037
7 __cxa_free_exception [call site] 00038
7 Buffer::getBuffer() [function] [call site] 00039
7 __cxa_allocate_exception [call site] 00040
7 std::runtime_error::runtime_error(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) [call site] 00041
7 __cxa_throw [call site] 00042
7 __cxa_free_exception [call site] 00043
6 Pl_LZWDecoder::getFirstChar(unsigned int) [function] [call site] 00044
6 __cxa_allocate_exception [call site] 00045
6 std::runtime_error::runtime_error(char const*) [call site] 00046
6 __cxa_throw [call site] 00047
6 std::runtime_error::~runtime_error() [call site] 00048
6 __cxa_free_exception [call site] 00049
6 Pl_LZWDecoder::addToTable(unsigned char) [function] [call site] 00050
7 __cxa_allocate_exception [call site] 00051
7 std::runtime_error::runtime_error(char const*) [call site] 00052
7 __cxa_throw [call site] 00053
7 std::runtime_error::~runtime_error() [call site] 00054
7 __cxa_free_exception [call site] 00055
7 Buffer::getBuffer() [function] [call site] 00056
7 Buffer::getSize() const [function] [call site] 00057
7 unsigned int QIntC::to_uint<unsigned long>(unsigned long const&) [function] [call site] 00058
7 __cxa_allocate_exception [call site] 00059
7 std::runtime_error::runtime_error(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) [call site] 00060
7 __cxa_throw [call site] 00061
7 __cxa_free_exception [call site] 00062
7 Buffer::Buffer(unsigned long) [function] [call site] 00063
8 Buffer::Members::Members(unsigned long, unsigned char*, bool) [function] [call site] 00064
7 Buffer::getBuffer() [function] [call site] 00065
7 Buffer::~Buffer() [function] [call site] 00066
6 Pipeline::next() const [function] [call site] 00067
6 __cxa_allocate_exception [call site] 00068
6 std::runtime_error::runtime_error(char const*) [call site] 00069
6 __cxa_throw [call site] 00070
6 std::runtime_error::~runtime_error() [call site] 00071
6 __cxa_free_exception [call site] 00072
6 Pipeline::next() const [function] [call site] 00073
6 Buffer::getBuffer() [function] [call site] 00074
6 Buffer::getSize() const [function] [call site] 00075
3 Pl_LZWDecoder::finish() [function] [call site] 00076
4 Pipeline::next() const [function] [call site] 00077
3 Pl_LZWDecoder::~Pl_LZWDecoder() [function] [call site] 00078
4 Pipeline::~Pipeline() [function] [call site] 00079
3 Pl_Discard::~Pl_Discard() [function] [call site] 00080
4 Pipeline::~Pipeline() [function] [call site] 00081
2 __cxa_begin_catch [call site] 00082
2 __cxa_end_catch [call site] 00083
2 __clang_call_terminate [call site] 00084
3 __cxa_begin_catch [call site] 00085