-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix sync for restarted instances #2437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
||
snprintf(id0, sizeof(id0), "%s/id:000000,*", qd_path); | ||
|
||
if (glob(id0, 0, NULL, &glob_result) == 0 && glob_result.gl_pathc == 1 && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to globfree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yes! had never worked with glob() before ...
} else { | ||
|
||
// something went wrong - this cannot be right, mabye the instance is | ||
// restarting, skip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't forget to free namelist, goto close_sync probably better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah true
src/afl-fuzz-run.c
Outdated
min_accept = 0; | ||
ck_write(id_fd, &min_accept, sizeof(u32), qd_synced_path); | ||
close(id_fd); | ||
continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about no "continue"; set next_min_accept=0 and let it continue the below sync?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then I need another jump point and adding that for just one jump source - I rather do the write instead there.
src/afl-fuzz-run.c
Outdated
@@ -816,6 +816,7 @@ void sync_fuzzers(afl_state_t *afl) { | ||
stat(glob_result.gl_pathv[0], &st) == 0) { | ||
|
||
// we found exactly one "id:000000,*" file and obtained its mtime | ||
globfree(glob_result); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
globfree(&glob_result); ?
looks good to me now |
No description provided.