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

Fuzzer details

Fuzzer: stb_png_read_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 8 4.39%
gold [1:9] 0 0.0%
yellow [10:29] 7 3.84%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 167 91.7%
All colors 182 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
3 3 1 :

['stbi__refill_buffer(stbi__context*)']

3 3 stbi__get8(stbi__context*) call site: 00000 /src/stb/tests/../stb_image.h:1616
0 2 1 :

['stbi__err(char const*)']

0 2 stbi__load_main(stbi__context*,int*,int*,int*,int,stbi__result_info*,int) call site: 00000 /src/stb/tests/../stb_image.h:1145
0 2 1 :

['stbi__err(char const*)']

0 2 stbi__do_png(stbi__png*,int*,int*,int*,int,stbi__result_info*) call site: 00000 /src/stb/tests/../stb_image.h:5269
0 2 1 :

['stbi__err(char const*)']

0 2 stbi__convert_format(unsignedchar*,int,int,unsignedint,unsignedint) call site: 00000 /src/stb/tests/../stb_image.h:1762
0 2 1 :

['stbi__err(char const*)']

0 2 stbi__convert_format16(unsignedshort*,int,int,unsignedint,unsignedint) call site: 00000 /src/stb/tests/../stb_image.h:1819
0 0 None 0 11 stbi__parse_png_file(stbi__png*,int,int) call site: 00000 /src/stb/tests/../stb_image.h:5228
0 0 None 0 2 stbi__compute_huffman_codes(stbi__zbuf*) call site: 00000 /src/stb/tests/../stb_image.h:4372
0 0 None 0 0 stbi__skip(stbi__context*,int) call site: 00000 /src/stb/tests/../stb_image.h:1649
0 0 None 0 0 stbi__getn(stbi__context*,unsignedchar*,int) call site: 00000 /src/stb/tests/../stb_image.h:1666
0 0 None 0 0 stbi__expand_png_palette(stbi__png*,unsignedchar*,int,int) call site: 00000 /src/stb/tests/../stb_image.h:4968
0 0 None 0 0 stbi__fill_bits(stbi__zbuf*) call site: 00000 /src/stb/tests/../stb_image.h:4202

Runtime coverage analysis

Covered functions
55
Functions that are reachable but not covered
9
Reachable functions
108
Percentage of reachable functions covered
91.67%
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/stb/tests/stbi_read_fuzzer.c 1
/src/stb/tests/../stb_image.h 53

Fuzzer: stbi_read_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 285 49.0%
gold [1:9] 87 14.9%
yellow [10:29] 36 6.19%
greenyellow [30:49] 46 7.91%
lawngreen 50+ 127 21.8%
All colors 581 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
372 372 3 :

['stbi__get32le(stbi__context*)', 'stbi__bmp_set_mask_defaults(stbi__bmp_data*, int)', 'stbi__get16le(stbi__context*)']

372 390 stbi__bmp_parse_header(stbi__context*,stbi__bmp_data*) call site: 00000 /src/stb/tests/../stb_image.h:5450
51 58 3 :

['stbi__get32le(stbi__context*)', 'stbi__get8(stbi__context*)', 'stbi__get16le(stbi__context*)']

51 58 stbi__bmp_test_raw(stbi__context*) call site: 00000 /src/stb/tests/../stb_image.h:5349
28 63 3 :

['stbi__get8(stbi__context*)', 'stbi__gif_parse_colortable(stbi__context*, unsigned char (*) [4], int, int)', 'stbi__get16le(stbi__context*)']

28 71 stbi__gif_header(stbi__context*,stbi__gif*,int*,int) call site: 00000 /src/stb/tests/../stb_image.h:6610
24 63 3 :

['stbi__convert_format(unsigned char*, int, int, unsigned int, unsigned int)', 'stbi__err(char const*)', 'stbi__convert_format16(unsigned short*, int, int, unsigned int, unsigned int)']

24 63 stbi__do_png(stbi__png*,int*,int*,int*,int,stbi__result_info*) call site: 00000 /src/stb/tests/../stb_image.h:5266
24 24 1 :

['stbi__convert_format16(unsigned short*, int, int, unsigned int, unsigned int)']

24 24 stbi__pnm_load(stbi__context*,int*,int*,int*,int,stbi__result_info*) call site: 00000 /src/stb/tests/../stb_image.h:7532
18 18 1 :

['stbi__jpeg_get_bit(stbi__jpeg*)']

18 18 stbi__jpeg_decode_block_prog_dc(stbi__jpeg*,short*,stbi__huffman*,int) call site: 00000 /src/stb/tests/../stb_image.h:2271
8 8 1 :

['stbi__convert_16_to_8(unsigned short*, int, int, int)']

12 12 stbi__load_and_postprocess_8bit(stbi__context*,int*,int*,int*,int) call site: 00000 /src/stb/tests/../stb_image.h:1269
3 3 1 :

['stbi__refill_buffer(stbi__context*)']

3 3 stbi__get8(stbi__context*) call site: 00000 /src/stb/tests/../stb_image.h:1616
0 76 4 :

['stbi__err(char const*)', 'stbi__get8(stbi__context*)', 'free', 'stbi__malloc_mad2(int, int, int)']

27 108 stbi__hdr_load(stbi__context*,int*,int*,int*,int,stbi__result_info*) call site: 00000 /src/stb/tests/../stb_image.h:7215
0 64 3 :

['stbi__get16be(stbi__context*)', 'stbi__get32be(stbi__context*)', 'stbi__skip(stbi__context*, int)']

0 72 stbi__psd_info(stbi__context*,int*,int*,int*) call site: 00000 /src/stb/tests/../stb_image.h:7364
0 62 4 :

['stbi__jpeg_huff_decode(stbi__jpeg*, stbi__huffman*)', 'stbi__err(char const*)', 'stbi__extend_receive(stbi__jpeg*, int)', 'stbi__grow_buffer_unsafe(stbi__jpeg*)']

0 62 stbi__jpeg_decode_block(stbi__jpeg*,short*,stbi__huffman*,stbi__huffman*,short*,int,unsignedshort*) call site: 00000 /src/stb/tests/../stb_image.h:2250
0 14 1 :

['stbi__get8(stbi__context*)']

0 14 stbi__gif_test_raw(stbi__context*) call site: 00000 /src/stb/tests/../stb_image.h:6582

Runtime coverage analysis

Covered functions
110
Functions that are reachable but not covered
61
Reachable functions
236
Percentage of reachable functions covered
74.15%
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/stb/tests/stbi_read_fuzzer.c 1
/src/stb/tests/../stb_image.h 111
/usr/local/bin/../include/c++/v1/math.h 2

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
stbi__jpeg_load(stbi__context*,int*,int*,int*,int,stbi__result_info*) /src/stb/tests/../stb_image.h 6 ['struct.stbi__context *', 'int *', 'int *', 'int *', 'int', 'struct.stbi__result_info *'] 8 0 77 6 3 99 0 464 268
stbi_load_gif_from_memory /src/stb/tests/../stb_image.h 8 ['char *', 'int', 'int **', 'int *', 'int *', 'int *', 'int *', 'int'] 6 0 87 9 4 52 0 179 89
stbi__bmp_load(stbi__context*,int*,int*,int*,int,stbi__result_info*) /src/stb/tests/../stb_image.h 6 ['struct.stbi__context *', 'int *', 'int *', 'int *', 'int', 'struct.stbi__result_info *'] 5 0 1665 216 75 37 0 180 86
stbi__psd_load(stbi__context*,int*,int*,int*,int,stbi__result_info*,int) /src/stb/tests/../stb_image.h 7 ['struct.stbi__context *', 'int *', 'int *', 'int *', 'int', 'struct.stbi__result_info *', 'int'] 4 0 945 130 46 33 0 128 74
stbi__pic_load(stbi__context*,int*,int*,int*,int,stbi__result_info*) /src/stb/tests/../stb_image.h 6 ['struct.stbi__context *', 'int *', 'int *', 'int *', 'int', 'struct.stbi__result_info *'] 4 0 218 27 11 33 0 96 43

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

Functions statically reachable by fuzzers
72.0%
157 / 218
Cyclomatic complexity statically reachable by fuzzers
88.0%
1500 / 1701

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