From 217223fd72c424bf12b8e21ee1230e56e7de1003 Mon Sep 17 00:00:00 2001 From: Mike Aizatsky Date: Wed, 2 Nov 2016 16:22:37 -0700 Subject: [PATCH] use seed corpus while running a fuzzer. Fixes #19 --- infra/base-images/base-libfuzzer/just_run | 7 +++++++ infra/base-images/libfuzzer-runner/run_fuzzer | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/infra/base-images/base-libfuzzer/just_run b/infra/base-images/base-libfuzzer/just_run index ededbee483ab..65354a7c984b 100755 --- a/infra/base-images/base-libfuzzer/just_run +++ b/infra/base-images/base-libfuzzer/just_run @@ -27,5 +27,12 @@ if [ -f $OPTIONS_FILE ]; then CMD_LINE="$CMD_LINE $OPTIONS_ARGS" fi +SEED_CORPUS="${FUZZER}_seed_corpus.zip" +if [ -f $SEED_CORPUS ]; then + mkdir /tmp/seed_corpus/ + unzip -d /tmp/seed_corpus/ $SEED_CORPUS + CMD_LINE="$CMD_LINE /tmp/seed_corpus/" +fi + echo $CMD_LINE bash -c "$CMD_LINE" diff --git a/infra/base-images/libfuzzer-runner/run_fuzzer b/infra/base-images/libfuzzer-runner/run_fuzzer index ededbee483ab..65354a7c984b 100755 --- a/infra/base-images/libfuzzer-runner/run_fuzzer +++ b/infra/base-images/libfuzzer-runner/run_fuzzer @@ -27,5 +27,12 @@ if [ -f $OPTIONS_FILE ]; then CMD_LINE="$CMD_LINE $OPTIONS_ARGS" fi +SEED_CORPUS="${FUZZER}_seed_corpus.zip" +if [ -f $SEED_CORPUS ]; then + mkdir /tmp/seed_corpus/ + unzip -d /tmp/seed_corpus/ $SEED_CORPUS + CMD_LINE="$CMD_LINE /tmp/seed_corpus/" +fi + echo $CMD_LINE bash -c "$CMD_LINE"