mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-10 01:01:33 +00:00
fix -N for forkserver
This commit is contained in:
parent
7b4d1c4089
commit
3cfc0174f7
@ -108,6 +108,7 @@ void afl_fsrv_init_dup(afl_forkserver_t *fsrv_to, afl_forkserver_t *from) {
|
||||
fsrv_to->out_file = from->out_file;
|
||||
fsrv_to->dev_urandom_fd = from->dev_urandom_fd;
|
||||
fsrv_to->out_fd = from->out_fd; // not sure this is a good idea
|
||||
fsrv_to->no_unlink = from->no_unlink;
|
||||
|
||||
// These are forkserver specific.
|
||||
fsrv_to->out_dir_fd = -1;
|
||||
@ -969,7 +970,7 @@ void afl_fsrv_write_to_testcase(afl_forkserver_t *fsrv, u8 *buf, size_t len) {
|
||||
|
||||
if (!fsrv->use_stdin && fsrv->out_file) {
|
||||
|
||||
if (fsrv->no_unlink) {
|
||||
if (unlikely(fsrv->no_unlink)) {
|
||||
|
||||
fd = open(fsrv->out_file, O_WRONLY | O_CREAT | O_TRUNC, 0600);
|
||||
|
||||
|
@ -243,7 +243,7 @@ static void write_with_gap(afl_state_t *afl, u8 *mem, u32 len, u32 skip_at,
|
||||
|
||||
} else if (afl->fsrv.out_file) {
|
||||
|
||||
if (afl->no_unlink) {
|
||||
if (unlikely(afl->no_unlink)) {
|
||||
|
||||
fd = open(afl->fsrv.out_file, O_WRONLY | O_CREAT | O_TRUNC, 0600);
|
||||
|
||||
@ -824,7 +824,7 @@ u8 trim_case(afl_state_t *afl, struct queue_entry *q, u8 *in_buf) {
|
||||
|
||||
s32 fd;
|
||||
|
||||
if (afl->no_unlink) {
|
||||
if (unlikely(afl->no_unlink)) {
|
||||
|
||||
fd = open(q->fname, O_WRONLY | O_CREAT | O_TRUNC, 0600);
|
||||
|
||||
|
@ -656,7 +656,7 @@ int main(int argc, char **argv_orig, char **envp) {
|
||||
case 'N': /* Unicorn mode */
|
||||
|
||||
if (afl->no_unlink) { FATAL("Multiple -N options not supported"); }
|
||||
afl->no_unlink = 1;
|
||||
afl->fsrv.no_unlink = afl->no_unlink = 1;
|
||||
|
||||
break;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user