Skip to content

Commit

Permalink
Emit error for incompatible AFL_MAP_SIZE.
Browse files Browse the repository at this point in the history
Fix #6
  • Loading branch information
GJDuck committed Sep 24, 2021
1 parent 3c9ccd2 commit cbc81c3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions afl-rt.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ static bool __afl_map_shm(void)
bool enabled = false;
if (id_str != NULL)
{
const char *map_size_str = getenv("AFL_MAP_SIZE");
if (map_size_str != 0 && atoi(map_size_str) < AREA_SIZE)
error("failed to set AFL area size to %s", map_size_str);
shm_id = (uint32_t)atoi(id_str);
(void)munmap(AREA_BASE, AREA_SIZE);
afl_area_ptr = (intptr_t)shmat(shm_id, AREA_BASE, 0);
Expand Down

0 comments on commit cbc81c3

Please sign in to comment.