From: Jérémie Astor Date: Sun, 10 May 2020 15:52:24 +0000 (+0200) Subject: :wrench: Update afl-hepler X-Git-Tag: nightly~1593 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=33e4b6c6b9d990901fb09e539f17fbcafcff5de6;p=gwion.git :wrench: Update afl-hepler --- diff --git a/scripts/afl-helper.sh b/scripts/afl-helper.sh index 5cd60101..49743361 100644 --- a/scripts/afl-helper.sh +++ b/scripts/afl-helper.sh @@ -1,11 +1,24 @@ -set -e [ $# -lt 2 ] && { echo "usage: afl-helper crash_dir out_dir" exit 1 } +# check false positive +FUZZER=$PWD/gwion-fuzz +FAULT=0 +pushd $1 +for a in id* +do + cat $a | $FUZZER || FAULT=$((FAULT+1)) +done +[ $FAULT = 0 ] && { echo "only false positive"; exit 1; } +popd + +set -e + DEST=$(realpath $2) -cd $DEST +[ -d $DEST ] || mkdir $DEST +pushd $DEST NUM=$(ls *.gw | wc -l) TMP=0 for a in *.gw @@ -13,10 +26,12 @@ do mv $a ${TMP}.gw TMP=$((TMP+1)) done +popd -cd $1 +pushd $1 for a in id* do cp $a $DEST/${NUM}.gw NUM=$((NUM+1)) done +popd