Skip to content

Commit 15f72e9

Browse files
committed
test: document fuzz_server usage, by OSS-Fuzz and locally
re #556 (comment)
1 parent f8be191 commit 15f72e9

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

test/fuzz_server.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
/*
2+
Fuzzing server for LibVNCServer.
3+
4+
This is used by OSS-Fuzz at https://android.googlesource.com/platform/external/oss-fuzz/+/refs/heads/upstream-master/projects/libvnc
5+
which is integrated into our CI at `.github/workflows/cifuzz.yaml`.
6+
OSS-Fuzz basically runs every executable in the $OUT dir with LLVMFuzzerTestOneInput in it,
7+
so other fuzzers can be added later on as well.
8+
9+
If you want to run the fuzzer locally, you have to build like that:
10+
11+
```
12+
mkdir build
13+
cd build
14+
CC=clang LIB_FUZZING_ENGINE="-fsanitize=fuzzer" CFLAGS="-fsanitize=address,fuzzer-no-link -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION=1" cmake ..
15+
cmake --build .
16+
```
17+
18+
and then execute `build/fuzz_server`. You can add some command line options, based on
19+
the fuzzing engine you have used to compile it, see https://llvm.org/docs/LibFuzzer.html
20+
21+
*/
22+
23+
124
#include <rfb/rfb.h>
225

326
static int initialized = 0;

0 commit comments

Comments
 (0)