diff options
author | van Hauser <vh@thc.org> | 2020-08-14 13:23:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-14 13:23:14 +0200 |
commit | a7537b5511ad767d2240cf2dc6d3e261daa676f9 (patch) | |
tree | 2cd8418efff844e634425e050ef716301adfd84b /src/afl-fuzz-state.c | |
parent | 15e799f7ae666418e75c6a79db833c5316b21f97 (diff) | |
parent | 83281503b3f1d4109c6f7a6af62a2133d55f1150 (diff) | |
download | afl++-a7537b5511ad767d2240cf2dc6d3e261daa676f9.tar.gz |
Merge branch 'debug' into dev
Diffstat (limited to 'src/afl-fuzz-state.c')
-rw-r--r-- | src/afl-fuzz-state.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/src/afl-fuzz-state.c b/src/afl-fuzz-state.c index d4de91a4..a8416eb1 100644 --- a/src/afl-fuzz-state.c +++ b/src/afl-fuzz-state.c @@ -75,7 +75,7 @@ static list_t afl_states = {.element_prealloc_count = 0}; /* Initializes an afl_state_t. */ -void afl_state_init(afl_state_t *afl, uint32_t map_size) { +void afl_state_init_1(afl_state_t *afl, uint32_t map_size) { /* thanks to this memset, growing vars like out_buf and out_size are NULL/0 by default. */ @@ -100,16 +100,6 @@ void afl_state_init(afl_state_t *afl, uint32_t map_size) { afl->cpu_aff = -1; /* Selected CPU core */ #endif /* HAVE_AFFINITY */ - afl->virgin_bits = ck_alloc(map_size); - afl->virgin_tmout = ck_alloc(map_size); - afl->virgin_crash = ck_alloc(map_size); - afl->var_bytes = ck_alloc(map_size); - afl->top_rated = ck_alloc(map_size * sizeof(void *)); - afl->clean_trace = ck_alloc(map_size); - afl->clean_trace_custom = ck_alloc(map_size); - afl->first_trace = ck_alloc(map_size); - afl->map_tmp_buf = ck_alloc(map_size); - afl->fsrv.use_stdin = 1; afl->fsrv.map_size = map_size; // afl_state_t is not available in forkserver.c @@ -161,6 +151,24 @@ void afl_state_init(afl_state_t *afl, uint32_t map_size) { } +void afl_state_init_2(afl_state_t *afl, uint32_t map_size) { + + afl->shm.map_size = map_size ? map_size : MAP_SIZE; + + afl->virgin_bits = ck_alloc(map_size); + afl->virgin_tmout = ck_alloc(map_size); + afl->virgin_crash = ck_alloc(map_size); + afl->var_bytes = ck_alloc(map_size); + afl->top_rated = ck_alloc(map_size * sizeof(void *)); + afl->clean_trace = ck_alloc(map_size); + afl->clean_trace_custom = ck_alloc(map_size); + afl->first_trace = ck_alloc(map_size); + afl->map_tmp_buf = ck_alloc(map_size); + + afl->fsrv.map_size = map_size; + +} + /*This sets up the environment variables for afl-fuzz into the afl_state * struct*/ |