add script to minimize corpus

This commit is contained in:
arvidn 2019-04-26 09:59:01 +02:00 committed by Arvid Norberg
parent ce52d9c685
commit f21a39496d
5 changed files with 30 additions and 24 deletions

View File

@ -75,3 +75,10 @@ large fuzz targets. Call `b2` like this::
b2 clang stage-large -j$(nproc)
sharing corpora
---------------
Before sharing your fuzz corpus, it should be minimized. There is a script
called `minimize.sh` which moves `corpus` to `prev-corpus` and copies over
a minimized set of inputs to a new `corpus` directory.

View File

@ -468,3 +468,4 @@ fuzzers
fuzzer
libFuzzer
clang's
prev

View File

@ -76,6 +76,7 @@ local LARGE_TARGETS =
resume_data
file_storage_add_file
sanitize_path
upnp
;
install stage : $(TARGETS) : <install-type>EXE <location>fuzzers ;

17
fuzzers/minimize.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
function minimize
{
mkdir corpus/${1}
./fuzzers/${1} -artifact_prefix=./${1}- -merge=1 corpus/${1} prev-corpus/${1}
}
mv corpus prev-corpus
mkdir corpus
for file in fuzzers/*; do
minimize $(basename $file) &
done
wait

View File

@ -1,3 +1,4 @@
#!/bin/bash
function run
{
@ -5,29 +6,8 @@ function run
./fuzzers/${1} -max_total_time=172800 -timeout=10 -artifact_prefix=./${1}- corpus/${1}
}
run torrent_info &
run parse_magnet_uri &
run bdecode_node &
run lazy_bdecode &
run parse_int &
run sanitize_path &
run escape_path &
run file_storage_add_file &
run base32decode &
run base32encode &
run base64encode &
run escape_string e&
run gzip &
run verify_encoding &
run convert_to_native &
run convert_from_native &
run utf8_wchar &
run wchar_utf8 &
run utf8_codepoint &
run http_parser &
run upnp &
run dht_node &
run utp &
run resume_data &
for file in fuzzers/*; do
run $(basename $file) &
done
wait