diff options
author | Jack Lloyd <[email protected]> | 2017-08-31 11:48:27 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-08-31 11:48:27 -0400 |
commit | 2799c22fd10506a45df7b84a2352def6c31067ee (patch) | |
tree | b9d41ed28c1f506f19f1503704a2ee9aedecb9a8 /src | |
parent | 6626ec872bc99048fe597889a993eba2f5474840 (diff) |
Avoid variable overwrite
I hate (and always forget) how Python list comprehensions leak the iteration variable.
Diffstat (limited to 'src')
-rwxr-xr-x | src/scripts/test_fuzzers.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/scripts/test_fuzzers.py b/src/scripts/test_fuzzers.py index b00ef0405..c4c2ef589 100755 --- a/src/scripts/test_fuzzers.py +++ b/src/scripts/test_fuzzers.py @@ -102,9 +102,9 @@ def main(args=None): run_fuzzer_func = run_fuzzer_gdb if options.gdb else run_fuzzer - for f in sorted(list(fuzzers_with_corpus)): - fuzzer_bin = os.path.join(fuzzer_dir, f) - corpus_subdir = os.path.join(corpus_dir, f) + for fuzzer in sorted(list(fuzzers_with_corpus)): + fuzzer_bin = os.path.join(fuzzer_dir, fuzzer) + corpus_subdir = os.path.join(corpus_dir, fuzzer) corpus_files = [os.path.join(corpus_subdir, l) for l in sorted(list(os.listdir(corpus_subdir)))] # We have to do this hack because multiprocessing's Pool.map doesn't support @@ -115,18 +115,18 @@ def main(args=None): (corpus_file, retcode, stdout, stderr) = result if retcode != 0: - print("Fuzzer %s crashed with input %s returncode %d" % (f, corpus_file, retcode)) + print("Fuzzer %s crashed with input %s returncode %d" % (fuzzer, corpus_file, retcode)) crash_count += 1 if len(stdout) != 0: - print("Fuzzer %s produced stdout on input %s:\n%s" % (f, corpus_file, stdout)) + print("Fuzzer %s produced stdout on input %s:\n%s" % (fuzzer, corpus_file, stdout)) stdout_count += 1 if len(stderr) != 0: - print("Fuzzer %s produced stderr on input %s:\n%s" % (f, corpus_file, stderr)) + print("Fuzzer %s produced stderr on input %s:\n%s" % (fuzzer, corpus_file, stderr)) stderr_count += 1 - print("Tested fuzzer %s with %d test cases, %d crashes" % (f, len(corpus_files), crash_count)) + print("Tested fuzzer %s with %d test cases, %d crashes" % (fuzzer, len(corpus_files), crash_count)) sys.stdout.flush() if crash_count > 0 or stderr_count > 0 or stdout_count > 0: |