diff options
author | Dominik Maier <domenukk@gmail.com> | 2020-02-10 00:19:25 +0100 |
---|---|---|
committer | Dominik Maier <domenukk@gmail.com> | 2020-02-10 00:19:25 +0100 |
commit | bf1898736915d34906704f82202d1a8890a3cec4 (patch) | |
tree | ab450a0a67ea5c2ec14c5ac9536e4a379d16eb3d /src/afl-common.c | |
parent | e19e06aba7e81a37f5f1a9974f061ab63bc86986 (diff) | |
parent | 33c18c36db70859fc484dd41a317634809d5c043 (diff) | |
download | afl++-bf1898736915d34906704f82202d1a8890a3cec4.tar.gz |
Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus into unicorn
Diffstat (limited to 'src/afl-common.c')
-rw-r--r-- | src/afl-common.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/afl-common.c b/src/afl-common.c index 6cb97cdf..958b9b7d 100644 --- a/src/afl-common.c +++ b/src/afl-common.c @@ -72,23 +72,27 @@ void detect_file_args(char** argv, u8* prog_in) { if (!prog_in) FATAL("@@ syntax is not supported by this tool."); - /* Be sure that we're always using fully-qualified paths. */ + use_stdin = 0; - if (prog_in[0] == '/') - aa_subst = prog_in; - else - aa_subst = alloc_printf("%s/%s", cwd, prog_in); + if (prog_in[0] != 0) { // not afl-showmap special case - use_stdin = 0; + /* Be sure that we're always using fully-qualified paths. */ + + if (prog_in[0] == '/') + aa_subst = prog_in; + else + aa_subst = alloc_printf("%s/%s", cwd, prog_in); - /* Construct a replacement argv value. */ + /* Construct a replacement argv value. */ - *aa_loc = 0; - n_arg = alloc_printf("%s%s%s", argv[i], aa_subst, aa_loc + 2); - argv[i] = n_arg; - *aa_loc = '@'; + *aa_loc = 0; + n_arg = alloc_printf("%s%s%s", argv[i], aa_subst, aa_loc + 2); + argv[i] = n_arg; + *aa_loc = '@'; - if (prog_in[0] != '/') ck_free(aa_subst); + if (prog_in[0] != '/') ck_free(aa_subst); + + } } |