mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-16 03:48:08 +00:00
add sanity check for -M/-S arguments
This commit is contained in:
@ -435,8 +435,12 @@ int main(int argc, char **argv_orig, char **envp) {
|
|||||||
|
|
||||||
u8 *c;
|
u8 *c;
|
||||||
|
|
||||||
if (afl->non_instrumented_mode) { FATAL("-M is not supported in non-instrumented mode "); }
|
if (afl->non_instrumented_mode) { FATAL("-M is not supported in non-instrumented mode"); }
|
||||||
if (afl->sync_id) { FATAL("Multiple -S or -M options not supported"); }
|
if (afl->sync_id) { FATAL("Multiple -S or -M options not supported"); }
|
||||||
|
|
||||||
|
/* sanity check for argument: should not begin with '-' (possible option) */
|
||||||
|
if (optarg && *optarg == '-') { FATAL("argument for -M started with a dash '-', which is used for options"); }
|
||||||
|
|
||||||
afl->sync_id = ck_strdup(optarg);
|
afl->sync_id = ck_strdup(optarg);
|
||||||
afl->skip_deterministic = 0; // force determinsitic fuzzing
|
afl->skip_deterministic = 0; // force determinsitic fuzzing
|
||||||
afl->old_seed_selection = 1; // force old queue walking seed selection
|
afl->old_seed_selection = 1; // force old queue walking seed selection
|
||||||
@ -465,8 +469,12 @@ int main(int argc, char **argv_orig, char **envp) {
|
|||||||
|
|
||||||
case 'S': /* secondary sync id */
|
case 'S': /* secondary sync id */
|
||||||
|
|
||||||
if (afl->non_instrumented_mode) { FATAL("-S is not supported in non-instrumented mode "); }
|
if (afl->non_instrumented_mode) { FATAL("-S is not supported in non-instrumented mode"); }
|
||||||
if (afl->sync_id) { FATAL("Multiple -S or -M options not supported"); }
|
if (afl->sync_id) { FATAL("Multiple -S or -M options not supported"); }
|
||||||
|
|
||||||
|
/* sanity check for argument: should not begin with '-' (possible option) */
|
||||||
|
if (optarg && *optarg == '-') { FATAL("argument for -M started with a dash '-', which is used for options"); }
|
||||||
|
|
||||||
afl->sync_id = ck_strdup(optarg);
|
afl->sync_id = ck_strdup(optarg);
|
||||||
afl->is_secondary_node = 1;
|
afl->is_secondary_node = 1;
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user