From da04f5e431506443847662a22d820078764a182a Mon Sep 17 00:00:00 2001 From: Leo Neat Date: Tue, 4 Feb 2020 10:54:28 -0800 Subject: [PATCH] [CIFuzz] Add seed and len control to fuzzer arguments (#3321) --- infra/cifuzz/fuzz_target.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/infra/cifuzz/fuzz_target.py b/infra/cifuzz/fuzz_target.py index 9272bd2c4..94eace86f 100644 --- a/infra/cifuzz/fuzz_target.py +++ b/infra/cifuzz/fuzz_target.py @@ -19,6 +19,7 @@ import subprocess import sys # pylint: disable=wrong-import-position +# pylint: disable=import-error sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import utils @@ -27,6 +28,8 @@ logging.basicConfig( format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.DEBUG) +LIBFUZZER_OPTIONS = '-seed=1337 -len_control=0' + class FuzzTarget: """A class to manage a single fuzz target. @@ -72,7 +75,8 @@ class FuzzTarget: command += [ '-e', 'FUZZING_ENGINE=libfuzzer', '-e', 'SANITIZER=address', '-e', 'RUN_FUZZER_MODE=interactive', 'gcr.io/oss-fuzz-base/base-runner', - 'bash', '-c', 'run_fuzzer {0}'.format(self.target_name) + 'bash', '-c', 'run_fuzzer {fuzz_target} {options}'.format( + fuzz_target=self.target_name, options=LIBFUZZER_OPTIONS) ] logging.info('Running command: %s', ' '.join(command)) process = subprocess.Popen(command,