about summary refs log tree commit diff
path: root/src/afl-common.c
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2021-03-24 11:26:10 +0100
committerGitHub <noreply@github.com>2021-03-24 11:26:10 +0100
commit7dc48478698ba73eeb045af3ca25e4a62e68b359 (patch)
tree8728a43b1e4560123c22398c4dbf5cca5f0eafdb /src/afl-common.c
parentee5078f43c44a022831cf83b6963930975188168 (diff)
parentd17abce59b846d2008eac3dd1a73939e91f4b653 (diff)
downloadafl++-7dc48478698ba73eeb045af3ca25e4a62e68b359.tar.gz
Merge pull request #817 from realmadsci/atat-plusplus
Make @@ handling more flexible
Diffstat (limited to 'src/afl-common.c')
-rw-r--r--src/afl-common.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/src/afl-common.c b/src/afl-common.c
index 37b4788c..1f9839a2 100644
--- a/src/afl-common.c
+++ b/src/afl-common.c
@@ -70,31 +70,26 @@ void detect_file_args(char **argv, u8 *prog_in, bool *use_stdin) {
 
       *use_stdin = false;
 
-      if (prog_in[0] != 0) {  // not afl-showmap special case
+      /* Be sure that we're always using fully-qualified paths. */
 
-        u8 *n_arg;
+      *aa_loc = 0;
 
-        /* Be sure that we're always using fully-qualified paths. */
+      /* Construct a replacement argv value. */
+      u8 *n_arg;
 
-        *aa_loc = 0;
+      if (prog_in[0] == '/') {
 
-        /* Construct a replacement argv value. */
+        n_arg = alloc_printf("%s%s%s", argv[i], prog_in, aa_loc + 2);
 
-        if (prog_in[0] == '/') {
-
-          n_arg = alloc_printf("%s%s%s", argv[i], prog_in, aa_loc + 2);
-
-        } else {
-
-          n_arg = alloc_printf("%s%s/%s%s", argv[i], cwd, prog_in, aa_loc + 2);
-
-        }
+      } else {
 
-        ck_free(argv[i]);
-        argv[i] = n_arg;
+        n_arg = alloc_printf("%s%s/%s%s", argv[i], cwd, prog_in, aa_loc + 2);
 
       }
 
+      ck_free(argv[i]);
+      argv[i] = n_arg;
+
     }
 
     i++;