Skip to content

Add fuzzer for protocol parser

hansmi requested to merge hansmi/usbredir:fuzz1 into master

libFuzzer is a library for coverage-guided fuzz testing (https://llvm.org/docs/LibFuzzer.html). It evolves inputs to cover as many code paths as possible.

This commit provides an initial implementation of a fuzzer for the usbredir protocol parser, exercising both sides of the connection (USB host and device).

The author decided to use libFuzzer's FuzzedDataProvider class for easier use of the generated input data, thus requiring the use of C++. libFuzzer mandates the use of the C++ linker anyway.

The fuzzing binary is only built when "--enable-fuzzing" is passed to the configure script.

As-is the fuzzer is compatible and tested with the oss-fuzz project (https://github.com/google/oss-fuzz).

Merge request reports