summaryrefslogtreecommitdiffhomepage
path: root/fuzzing/oss-fuzz.sh
blob: 1fe5ecda8a4e8543c3558b60538712e917a072cb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash -eu

# Build unit
./configure --no-regex --no-pcre2 --fuzz="$LIB_FUZZING_ENGINE"
make fuzz -j"$(nproc)"

# Copy all fuzzers.
cp build/fuzz_* $OUT/

# cd into fuzzing dir
pushd fuzzing/
cp fuzz_http.dict $OUT/fuzz_http_controller.dict
cp fuzz_http.dict $OUT/fuzz_http_h1p.dict
cp fuzz_http.dict $OUT/fuzz_http_h1p_peer.dict

# Create temporary directories.
cp -r fuzz_http_seed_corpus/ fuzz_http_controller_seed_corpus/
cp -r fuzz_http_seed_corpus/ fuzz_http_h1p_seed_corpus/
cp -r fuzz_http_seed_corpus/ fuzz_http_h1p_peer_seed_corpus/

zip -r $OUT/fuzz_basic_seed_corpus.zip fuzz_basic_seed_corpus/
zip -r $OUT/fuzz_http_controller_seed_corpus.zip  fuzz_http_controller_seed_corpus/
zip -r $OUT/fuzz_http_h1p_seed_corpus.zip  fuzz_http_h1p_seed_corpus/
zip -r $OUT/fuzz_http_h1p_peer_seed_corpus.zip  fuzz_http_h1p_peer_seed_corpus/
zip -r $OUT/fuzz_json_seed_corpus.zip fuzz_json_seed_corpus/

# Delete temporary directories.
rm -r fuzz_http_controller_seed_corpus/ fuzz_http_h1p_seed_corpus/ fuzz_http_h1p_peer_seed_corpus/
popd