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

Fuzzer details

Fuzzer: server_fuzzer

Call tree

The calltree shows the control flow of the fuzzer. This is overlaid with coverage information to display how much of the potential code a fuzzer can reach is in fact covered at runtime. In the following there is a link to a detailed calltree visualisation as well as a bitmap showing a high-level view of the calltree. For further information about these topics please see the glossary for full calltree and calltree overview

Call tree overview bitmap:

The distribution of callsites in terms of coloring is
Color Runtime hitcount Callsite count Percentage
red 0 79 30.0%
gold [1:9] 13 4.94%
yellow [10:29] 8 3.04%
greenyellow [30:49] 8 3.04%
lawngreen 50+ 155 58.9%
All colors 263 100

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
58 58 2 :

['std::__1::function ::operator bool[abi:v180000]() const', 'httplib::detail::get_multipart_ranges_data_length(httplib::Request const&, std::__1::basic_string , std::__1::allocator > const&, std::__1::basic_string , std::__1::allocator > const&, unsigned long)']

58 124 httplib::Server::apply_ranges(httplib::Requestconst&,httplib::Response&,std::__1::basic_string ,std::__1::allocator >&,std::__1::basic_string ,std::__1::allocator >&)const call site: 00000 /src/cpp-httplib/test/fuzzing/../../httplib.h:6676
55 55 3 :

['_ZNSt3__110unique_ptrIN7httplib6detail11MatcherBaseENS_14default_deleteIS3_EEEC2B7v180000INS2_17PathParamsMatcherENS4_IS8_EEvvEEONS0_IT_T0_EE', 'std::__1::unique_ptr >::~unique_ptr[abi:v180000]()', '_ZN7httplib6detail11make_uniqueINS0_17PathParamsMatcherEJRKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEENS3_9enable_ifIXntsr3std8is_arrayIT_EE5valueENS3_10unique_ptrISD_NS3_14default_deleteISD_EEEEE4typeEDpOT0_']

55 55 httplib::Server::make_matcher(std::__1::basic_string ,std::__1::allocator >const&) call site: 00000 /src/cpp-httplib/test/fuzzing/../../httplib.h:5860
10 10 4 :

['std::current_exception()', 'std::__1::function ::operator()(httplib::Request const&, httplib::Response&, std::exception_ptr) const', 'std::exception_ptr::exception_ptr(std::exception_ptr const&)', 'std::exception_ptr::~exception_ptr()']

26 2167 httplib::Server::process_request(httplib::Stream&,bool,bool&,std::__1::function const&) call site: 00000 /src/cpp-httplib/test/fuzzing/../../httplib.h:6874
4 4 1 :

['httplib::detail::skip_content_with_length(httplib::Stream&, unsigned long)']

4 4 httplib::detail::read_content (httplib::Stream&,httplib::Request&,unsignedlong,int&,std::__1::function ,std::__1::function ,bool)::{lambda(std::__1::function const&)#1}::operator()(std::__1::function const&)const call site: 00000 /src/cpp-httplib/test/fuzzing/../../httplib.h:4184
0 0 None 207 331 httplib::Server::write_response_core(httplib::Stream&,bool,httplib::Requestconst&,httplib::Response&,bool) call site: 00000 /src/cpp-httplib/test/fuzzing/../../httplib.h:6194
0 0 None 207 215 httplib::Server::write_response_core(httplib::Stream&,bool,httplib::Requestconst&,httplib::Response&,bool) call site: 00000 /src/cpp-httplib/test/fuzzing/../../httplib.h:6214
0 0 1 :

['std::__1::function ::operator()(httplib::Request const&, httplib::Response&) const']

44 3514 httplib::Server::process_request(httplib::Stream&,bool,bool&,std::__1::function const&) call site: 00000 /src/cpp-httplib/test/fuzzing/../../httplib.h:6853
0 0 None 24 263 httplib::detail::MultipartFormDataParser::parse(charconst*,unsignedlong,std::__1::function const&,std::__1::function const&) call site: 00000 /src/cpp-httplib/test/fuzzing/../../httplib.h:4660
0 0 None 24 263 httplib::detail::MultipartFormDataParser::parse(charconst*,unsignedlong,std::__1::function const&,std::__1::function const&) call site: 00000 /src/cpp-httplib/test/fuzzing/../../httplib.h:4679
0 0 None 8 781 httplib::Server::process_request(httplib::Stream&,bool,bool&,std::__1::function const&) call site: 00000 /src/cpp-httplib/test/fuzzing/../../httplib.h:6800
0 0 None 2 343 httplib::Server::routing(httplib::Request&,httplib::Response&,httplib::Stream&) call site: 00000 /src/cpp-httplib/test/fuzzing/../../httplib.h:6595
0 0 None 2 343 httplib::Server::routing(httplib::Request&,httplib::Response&,httplib::Stream&) call site: 00000 /src/cpp-httplib/test/fuzzing/../../httplib.h:6601

Runtime coverage analysis

Covered functions
163
Functions that are reachable but not covered
110
Reachable functions
275
Percentage of reachable functions covered
60.0%
NB: The sum of covered functions and functions that are reachable but not covered need not be equal to Reachable functions . This is because the reachability analysis is an approximation and thus at runtime some functions may be covered that are not included in the reachability analysis. This is a limitation of our static analysis capabilities.
Function name source code lines source lines hit percentage hit

Files reached

filename functions hit
/src/cpp-httplib/test/fuzzing/server_fuzzer.cc 4
/src/cpp-httplib/test/fuzzing/../../httplib.h 111

Analyses and suggestions

Optimal target analysis

Remaining optimal interesting functions

The following table shows a list of functions that are optimal targets. Optimal targets are identified by finding the functions that in combination, yield a high code coverage.

Func name Functions filename Arg count Args Function depth hitcount instr count bb count cyclomatic complexity Reachable functions Incoming references total cyclomatic complexity Unreached complexity
httplib::Server::read_content_core(httplib::Stream&,httplib::Request&,httplib::Response&,std::__1::function ,std::__1::function ,std::__1::function )const::{lambda(charconst*,unsignedlong,unsignedlong,unsignedlong)#1}::operator()(charconst*,unsignedlong,unsignedlong,unsignedlong)const /src/cpp-httplib/test/fuzzing/../../httplib.h 5 ['N/A', 'N/A', 'size_t', 'size_t', 'size_t'] 6 0 36 3 2 54 0 265 227
LLVMFuzzerInitialize /src/cpp-httplib/test/fuzzing/server_fuzzer.cc 2 ['N/A', 'N/A'] 6 0 201 34 23 31 0 129 129
httplib::ClientImpl::create_and_connect_socket(httplib::ClientImpl::Socket&,httplib::Error&) /src/cpp-httplib/test/fuzzing/../../httplib.h 3 ['N/A', 'N/A', 'N/A'] 8 0 46 6 3 40 0 109 109
httplib::detail::write_content_chunked ,std::__1::allocator >const&,std::__1::basic_string ,std::__1::allocator >const&)::{lambda()#1},httplib::detail::compressor>(httplib::Stream&,std::__1::function const&,httplib::Server::write_content_with_provider(httplib::Stream&,httplib::Requestconst&,httplib::Response&,std::__1::basic_string ,std::__1::allocator >const&,std::__1::basic_string ,std::__1::allocator >const&)::{lambda()#1}const&,httplib::detail::compressor&,httplib::Error&)::{lambda(std::__1::multimap ,std::__1::allocator >,std::__1::basic_string ,std::__1::allocator >,httplib::detail::ci,std::__1::allocator ,std::__1::allocator >const,std::__1::basic_string ,std::__1::allocator >>>>const&)#1}::operator()(std::__1::multimap ,std::__1::allocator >,std::__1::basic_string ,std::__1::allocator >,httplib::detail::ci,std::__1::allocator ,std::__1::allocator >const,std::__1::basic_string ,std::__1::allocator >>>>const)const /src/cpp-httplib/test/fuzzing/../../httplib.h 2 ['N/A', 'N/A'] 2 0 22 3 2 10 0 93 81
httplib::Server::process_and_close_socket(int) /src/cpp-httplib/test/fuzzing/../../httplib.h 2 ['N/A', 'int'] 14 0 49 3 2 296 0 1511 49
httplib::detail::SocketStream::write(charconst*,unsignedlong) /src/cpp-httplib/test/fuzzing/../../httplib.h 3 ['N/A', 'N/A', 'size_t'] 6 0 40 6 3 32 0 53 40

Implementing fuzzers that target the above functions will improve reachability such that it becomes:

Functions statically reachable by fuzzers
61.0%
200 / 329
Cyclomatic complexity statically reachable by fuzzers
78.0%
2013 / 2566

All functions overview

If you implement fuzzers for these functions, the status of all functions in the project will be:

Func name Functions filename Args Function call depth Reached by Fuzzers Fuzzers runtime hit Func lines hit % I Count BB Count Cyclomatic complexity Functions reached Reached by functions Accumulated cyclomatic complexity Undiscovered complexity