Skip to content
This repository was archived by the owner on Apr 15, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions afl-cov
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import signal
import sys
import time
from shutil import rmtree
from shutil import copyfile
from sys import argv
from tempfile import NamedTemporaryFile
from typing import Any, Dict, Iterator, List, Union, Optional, Tuple
Expand Down Expand Up @@ -175,6 +176,14 @@ def process_afl_test_cases(cargs: argparse.Namespace) -> bool:
if f_ctr == len(new_files):
last_file = True


if cargs.afl_file:
try:
copyfile(f, cargs.afl_file)
except Exception:
print("[-] Cannot copy file")
sys.exit(1)

if cargs.cover_corpus and last_dir and last_file:
# in --cover-corpus mode, only run lcov after all AFL
# test cases have been processed
Expand Down Expand Up @@ -1536,6 +1545,9 @@ def parse_cmdline() -> argparse.Namespace:
p.add_argument(
"-T", "--timeout", type=str, help="timeout (default 5 seconds)", default="5"
)
p.add_argument(
"--afl-file", type=str, help="Filepath that is passed to AFL with -f argument", default=""
)

return p.parse_args()

Expand Down