aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-10-12 04:41:04 +0200
committervan Hauser <vh@thc.org>2020-10-12 04:41:04 +0200
commitaef0cd5877e0e4d3450610d48c4f6188a114d2b3 (patch)
treef1fa9aebd69402b89d3d362ac6c562a656f7c24e /src
parentd6da5605c80d65091375c08ae5389d14d671500a (diff)
downloadafl++-aef0cd5877e0e4d3450610d48c4f6188a114d2b3.tar.gz
fix sync mode
Diffstat (limited to 'src')
-rw-r--r--src/afl-fuzz.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/afl-fuzz.c b/src/afl-fuzz.c
index d42a0d36..e58d3d34 100644
--- a/src/afl-fuzz.c
+++ b/src/afl-fuzz.c
@@ -249,7 +249,7 @@ static int stricmp(char const *a, char const *b) {
int main(int argc, char **argv_orig, char **envp) {
- s32 opt, i;
+ s32 opt, i, auto_sync = 0;
u64 prev_queued = 0;
u32 sync_interval_cnt = 0, seek_to = 0, show_help = 0, map_size = MAP_SIZE;
u8 *extras_dir[4];
@@ -847,7 +847,7 @@ int main(int argc, char **argv_orig, char **envp) {
"Eißfeldt, Andrea Fioraldi and Dominik Maier");
OKF("afl++ is open source, get it at "
"https://github.com/AFLplusplus/AFLplusplus");
- OKF("NOTE: This is v3.x which changes several defaults and behaviours - see "
+ OKF("NOTE: This is v3.x which changes defaults and behaviours - see "
"README.md");
if (afl->sync_id && afl->is_main_node &&
@@ -880,6 +880,15 @@ int main(int argc, char **argv_orig, char **envp) {
afl->power_name = power_names[afl->schedule];
+ if (!afl->sync_id) {
+
+ auto_sync = 1;
+ afl->sync_id = ck_strdup("default");
+ afl->is_secondary_node = 1;
+ OKF("no -M/-S set, autoconfiguring for \"-S %s\"", afl->sync_id);
+
+ }
+
if (afl->sync_id) { fix_up_sync(afl); }
if (!strcmp(afl->in_dir, afl->out_dir)) {
@@ -1137,19 +1146,15 @@ int main(int argc, char **argv_orig, char **envp) {
WARNF("it is wasteful to run more than one main node!");
sleep(1);
- } else if (afl->is_secondary_node && check_main_node_exists(afl) == 0) {
+ } else if (!auto_sync && afl->is_secondary_node &&
+
+ check_main_node_exists(afl) == 0) {
WARNF(
"no -M main node found. It is recommended to run exactly one main "
"instance.");
sleep(1);
- } else if (!afl->sync_id) {
-
- afl->sync_id = "default";
- afl->is_secondary_node = 1;
- OKF("no -M/-S set, autoconfiguring for \"-S %s\"", afl->sync_id);
-
}
#ifdef RAND_TEST_VALUES
@@ -1419,7 +1424,7 @@ int main(int argc, char **argv_orig, char **envp) {
break;
case 4:
// if not in sync mode, enable deterministic mode?
- // if (!afl->sync_dir) afl->skip_deterministic = 0;
+ // if (!afl->sync_id) afl->skip_deterministic = 0;
afl->expand_havoc = 5;
break;
case 5: