diff options
author | Rick van Schijndel <Mindavi@users.noreply.github.com> | 2020-04-15 12:08:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-15 12:08:33 +0200 |
commit | 48f7f7a17b8ac848e261cfc47800e1e6d7a51bcb (patch) | |
tree | f2fb8b3c75d47baca33ef72c650bebef916a8f9d /llvm_mode/afl-clang-fast.c | |
parent | 115ee8bad5e8383798b41a754198356b55e50980 (diff) | |
download | afl++-48f7f7a17b8ac848e261cfc47800e1e6d7a51bcb.tar.gz |
afl-clang-fast: fail when binary name can't be used to determine build mode (#318)
Diffstat (limited to 'llvm_mode/afl-clang-fast.c')
-rw-r--r-- | llvm_mode/afl-clang-fast.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm_mode/afl-clang-fast.c b/llvm_mode/afl-clang-fast.c index 49318f2e..f58c22dd 100644 --- a/llvm_mode/afl-clang-fast.c +++ b/llvm_mode/afl-clang-fast.c @@ -184,7 +184,7 @@ static void edit_params(u32 argc, char **argv, char **envp) { sprintf(llvm_fullpath, CLANGPP_BIN); cc_params[0] = alt_cxx && *alt_cxx ? alt_cxx : (u8 *)llvm_fullpath; - } else { + } else if (!strcmp(name, "afl-clang-fast") || !strcmp(name, "afl-clang-lto")) { u8 *alt_cc = getenv("AFL_CC"); if (USE_BINDIR) @@ -193,6 +193,9 @@ static void edit_params(u32 argc, char **argv, char **envp) { sprintf(llvm_fullpath, CLANG_BIN); cc_params[0] = alt_cc && *alt_cc ? alt_cc : (u8 *)llvm_fullpath; + } else { + fprintf(stderr, "Name of the binary: %s\n", argv[0]); + FATAL("Name of the binary is not a known name, expected afl-clang-fast(++) or afl-clang-lto(++)"); } /* There are three ways to compile with afl-clang-fast. In the traditional |