Skip to content
This repository has been archived by the owner on Nov 29, 2021. It is now read-only.

Commit

Permalink
no longer quits execution at addr 0x0
Browse files Browse the repository at this point in the history
  • Loading branch information
domenukk committed May 6, 2021
1 parent f59df67 commit 8a217c5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion afl.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@ uc_afl_ret uc_afl_forkserver_start(uc_engine *uc, uint64_t *exits, size_t exit_c
fprintf(stderr, "[!] Unicorn Engine passed to uc_afl_fuzz is NULL!\n");
return UC_AFL_RET_ERROR;
}
if (!exit_count) {
if (!exits) {
fprintf(stderr, "[!] Nullptr provided for exits.\n");
return UC_AFL_RET_ERROR;
}
if (!exit_count) {
fprintf(stderr, "[!] No exits provided (exit_count was 0).\n");
return UC_AFL_RET_ERROR;
}
if (unlikely(uc->afl_area_ptr)) {
#if defined(AFL_DEBUG)
fprintf(stderr, "[!] forkserver_start(...) called twice. Already fuzzing!\n");
Expand All @@ -55,6 +59,8 @@ uc_afl_ret uc_afl_forkserver_start(uc_engine *uc, uint64_t *exits, size_t exit_c
}
memcpy(uc->exits, exits, sizeof(exits[0]) * exit_count);
uc->exit_count = exit_count;
// Set addr_end to make sure unicorn will not stop at addr 0x0.
uc->addr_end = uc->exits[0];

/* Fork() :) */
return uc->afl_forkserver_start(uc);
Expand Down

0 comments on commit 8a217c5

Please sign in to comment.