From d9c1e9125f2863a90c2910b995cb6920dc0d5734 Mon Sep 17 00:00:00 2001 From: Nick Terrell Date: Wed, 27 Sep 2017 18:23:06 -0700 Subject: [PATCH] [fuzz] Small changes for oss-fuzz integration --- tests/fuzz/default.options | 2 ++ tests/fuzz/fuzz.py | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 tests/fuzz/default.options diff --git a/tests/fuzz/default.options b/tests/fuzz/default.options new file mode 100644 index 00000000..8ea85883 --- /dev/null +++ b/tests/fuzz/default.options @@ -0,0 +1,2 @@ +[libfuzzer] +max_len = 8192 diff --git a/tests/fuzz/fuzz.py b/tests/fuzz/fuzz.py index 9864d822..b591e4f6 100755 --- a/tests/fuzz/fuzz.py +++ b/tests/fuzz/fuzz.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#!/usr/bin/env python # ################################################################ # Copyright (c) 2016-present, Facebook, Inc. @@ -757,6 +757,10 @@ def zip_cmd(args): subprocess.check_call(cmd + seeds) +def list_cmd(args): + print("\n".join(TARGETS)) + + def short_help(args): name = args[0] print("Usage: {} [OPTIONS] COMMAND [ARGS]...\n".format(name)) @@ -776,6 +780,7 @@ def help(args): print("\tgen\t\tGenerate a seed corpus for a fuzzer") print("\tminimize\tMinimize the test corpora") print("\tzip\t\tZip the minimized corpora up") + print("\tlist\t\tList the available targets") def main(): @@ -802,6 +807,8 @@ def main(): return minimize(args) if command == "zip": return zip_cmd(args) + if command == "list": + return list_cmd(args) short_help(args) print("Error: No such command {} (pass -h for help)".format(command)) return 1