mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-16 03:48:08 +00:00
new auto map
This commit is contained in:
@ -1584,7 +1584,7 @@ int main(int argc, char **argv_orig, char **envp) {
|
||||
if (!afl->non_instrumented_mode && !afl->fsrv.qemu_mode &&
|
||||
!afl->unicorn_mode) {
|
||||
|
||||
if (map_size <= 8000000&& !afl->non_instrumented_mode &&
|
||||
if (map_size <= 8000000 && !afl->non_instrumented_mode &&
|
||||
!afl->fsrv.qemu_mode && !afl->unicorn_mode) {
|
||||
|
||||
afl->fsrv.map_size = 8000000; // dummy temporary value
|
||||
@ -1595,11 +1595,10 @@ int main(int argc, char **argv_orig, char **envp) {
|
||||
u32 new_map_size = afl_fsrv_get_mapsize(
|
||||
&afl->fsrv, afl->argv, &afl->stop_soon, afl->afl_env.afl_debug_child);
|
||||
|
||||
if (new_map_size && new_map_size != map_size) {
|
||||
|
||||
// only reinitialize when it makes sense
|
||||
if (map_size < new_map_size ||
|
||||
(new_map_size > map_size && new_map_size - map_size > MAP_SIZE)) {
|
||||
(!afl->cmplog_binary && new_map_size < map_size &&
|
||||
map_size - new_map_size > MAP_SIZE)) {
|
||||
|
||||
OKF("Re-initializing maps to %u bytes", new_map_size);
|
||||
|
||||
@ -1624,18 +1623,14 @@ int main(int argc, char **argv_orig, char **envp) {
|
||||
afl_fsrv_start(&afl->fsrv, afl->argv, &afl->stop_soon,
|
||||
afl->afl_env.afl_debug_child);
|
||||
|
||||
}
|
||||
|
||||
map_size = new_map_size;
|
||||
|
||||
} else {
|
||||
}
|
||||
|
||||
afl->fsrv.map_size = map_size;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (afl->cmplog_binary) {
|
||||
|
||||
ACTF("Spawning cmplog forkserver");
|
||||
@ -1658,10 +1653,9 @@ int main(int argc, char **argv_orig, char **envp) {
|
||||
afl_fsrv_get_mapsize(&afl->cmplog_fsrv, afl->argv, &afl->stop_soon,
|
||||
afl->afl_env.afl_debug_child);
|
||||
|
||||
if (new_map_size && new_map_size != map_size) {
|
||||
|
||||
// only reinitialize when it needs to be larger
|
||||
if (map_size < new_map_size) {
|
||||
if (map_size < new_map_size ||
|
||||
(new_map_size < map_size && map_size - new_map_size > MAP_SIZE)) {
|
||||
|
||||
OKF("Re-initializing maps to %u bytes due cmplog", new_map_size);
|
||||
|
||||
@ -1691,8 +1685,6 @@ int main(int argc, char **argv_orig, char **envp) {
|
||||
afl_fsrv_start(&afl->cmplog_fsrv, afl->argv, &afl->stop_soon,
|
||||
afl->afl_env.afl_debug_child);
|
||||
|
||||
}
|
||||
|
||||
map_size = new_map_size;
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user