fix qemu/unicorn oob

This commit is contained in:
vanhauser-thc
2021-12-13 15:45:41 +01:00
parent 630272bac5
commit 57bc3c0701
2 changed files with 5 additions and 0 deletions

View File

@ -242,6 +242,9 @@ u8 *afl_shm_init(sharedmem_t *shm, size_t map_size,
#else
u8 *shm_str;
// handle qemu/unicorn compcov map overwrite
if (map_size == MAP_SIZE) { map_size += 8; }
shm->shm_id =
shmget(IPC_PRIVATE, map_size, IPC_CREAT | IPC_EXCL | DEFAULT_PERMISSION);
if (shm->shm_id < 0) {