From b382e898674910bf6cf1c0aa060dca92ca56a902 Mon Sep 17 00:00:00 2001 From: Jonathan Rudenberg Date: Mon, 15 Jan 2018 13:42:16 -0500 Subject: [PATCH] [infra] Allow passing environment variables to run_fuzzer (#1075) This allows setting additional sanitizer options, for example: run_fuzzer -e ASAN_OPTIONS=-allocator_may_return_null=0 --- infra/helper.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/infra/helper.py b/infra/helper.py index ae9762666..ec03157f5 100755 --- a/infra/helper.py +++ b/infra/helper.py @@ -75,6 +75,7 @@ def main(): run_fuzzer_parser = subparsers.add_parser( 'run_fuzzer', help='Run a fuzzer.') _add_engine_args(run_fuzzer_parser) + _add_environment_args(run_fuzzer_parser) run_fuzzer_parser.add_argument('project_name', help='name of the project') run_fuzzer_parser.add_argument('fuzzer_name', help='name of the fuzzer') run_fuzzer_parser.add_argument('fuzzer_args', help='arguments to pass to the fuzzer', @@ -333,6 +334,8 @@ def run_fuzzer(args): return 1 env = ['FUZZING_ENGINE=' + args.engine] + if args.e: + env += args.e run_args = sum([['-e', v] for v in env], []) + [ '-v', '%s:/out' % os.path.join(BUILD_DIR, 'out', args.project_name),