mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-17 04:18:06 +00:00
afl-showmap: Allow @@ to be part of an arg
The previous implementation of "@@ handling" in afl-showmap differed greatly from how it was handled in afl-fuzz and how the documentation presented it. It used to require that the @@ be its own argument separated by whitespace and could not be used in situations like "--file=@@". This change standardizes it to use detect_file_args() like everybody else does, so that it will have the expected and documented behavior.
This commit is contained in:
@ -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] == '/') {
|
||||
} else {
|
||||
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
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++;
|
||||
|
Reference in New Issue
Block a user