fix qemu/unicorn oob
MODIFY
docs/Changelog.md
docs/Changelog.md
@@ -34,6 +34,8 @@ sending a mail to <afl-users+subscribe@googlegroups.com>.
- better banner
- more effective cmplog mode
- more often update the UI when in input2stage mode
+ - qemu_mode/unicorn_mode: fixed OOB write when using libcompcov,
+ thanks to kotee4ko for reporting!
- frida_mode:
- better performance, bug fixes
- David Carlier added Android support :)

MODIFY
src/afl-sharedmem.c
src/afl-sharedmem.c
@@ -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) {

fix qemu/unicorn oob