mirror of https://github.com/google/oss-fuzz.git
[usrsctp] Add fuzzer for usrsctp (#4318)
* merge a new fuzzer o * merge a new fuzzer of usrsctp
This commit is contained in:
parent
5125d29c64
commit
ae2d4de73a
|
@ -19,13 +19,21 @@ cmake -Dsctp_build_programs=0 -Dsctp_debug=0 -Dsctp_invariants=1 -Dsctp_build_fu
|
|||
make -j$(nproc)
|
||||
cd fuzzer
|
||||
|
||||
TARGETS="fuzzer_connect fuzzer_listen"
|
||||
TARGETS="fuzzer_connect fuzzer_listen fuzzer_fragment"
|
||||
|
||||
CORPUS="CORPUS_CONNECT CORPUS_LISTEN CORPUS_FRAGMENT"
|
||||
|
||||
while [ -n "$TARGETS" ]
|
||||
do
|
||||
target=`echo "$TARGETS" | cut -d ' ' -f 1`
|
||||
TARGETS=`echo "$TARGETS" | sed 's/[^ ]* *\(.*\)$/\1/'`
|
||||
corpus=`echo "$CORPUS" | cut -d ' ' -f 1`
|
||||
CORPUS=`echo "$CORPUS" | sed 's/[^ ]* *\(.*\)$/\1/'`
|
||||
|
||||
for target in $TARGETS; do
|
||||
$CC $CFLAGS -DFUZZING_STAGE=0 -I . -I ../usrsctplib/ -c ${target}.c -o $OUT/${target}.o
|
||||
$CXX $CXXFLAGS -o $OUT/${target} $OUT/${target}.o $LIB_FUZZING_ENGINE ../usrsctplib/libusrsctp.a
|
||||
rm -f $OUT/${target}.o
|
||||
done
|
||||
|
||||
zip -jr fuzzer_connect_seed_corpus.zip CORPUS_CONNECT/
|
||||
cp fuzzer_connect_seed_corpus.zip $OUT/
|
||||
zip -jr ${target}_seed_corpus.zip ${corpus}/
|
||||
cp ${target}_seed_corpus.zip $OUT/
|
||||
done
|
||||
|
|
Loading…
Reference in New Issue