unified pointer placement

This commit is contained in:
Dominik Maier
2020-03-10 22:04:05 +01:00
parent 2832cb643d
commit cc1d6b33b1
46 changed files with 1040 additions and 1043 deletions

View File

@ -52,7 +52,7 @@ ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4 ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4 ContinuationIndentWidth: 4
Cpp11BracedListStyle: true Cpp11BracedListStyle: true
DerivePointerAlignment: true DerivePointerAlignment: false
DisableFormat: false DisableFormat: false
ExperimentalAutoDetectBinPacking: false ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true FixNamespaceComments: true

View File

@ -331,6 +331,7 @@ void afl_fsrv_start(afl_forkserver_t *fsrv, char **argv) {
rlen = read(fsrv->fsrv_st_fd, &status, 4); rlen = read(fsrv->fsrv_st_fd, &status, 4);
} }
} else { } else {
rlen = read(fsrv->fsrv_st_fd, &status, 4); rlen = read(fsrv->fsrv_st_fd, &status, 4);

View File

@ -190,7 +190,8 @@ void init_cmplog_forkserver(afl_state_t *afl) {
timeout.tv_sec = ((afl->fsrv.exec_tmout * FORK_WAIT_MULT) / 1000); timeout.tv_sec = ((afl->fsrv.exec_tmout * FORK_WAIT_MULT) / 1000);
timeout.tv_usec = ((afl->fsrv.exec_tmout * FORK_WAIT_MULT) % 1000) * 1000; timeout.tv_usec = ((afl->fsrv.exec_tmout * FORK_WAIT_MULT) % 1000) * 1000;
int sret = select(afl->cmplog_fsrv_st_fd + 1, &readfds, NULL, NULL, &timeout); int sret =
select(afl->cmplog_fsrv_st_fd + 1, &readfds, NULL, NULL, &timeout);
if (sret == 0) { if (sret == 0) {
@ -201,6 +202,7 @@ void init_cmplog_forkserver(afl_state_t *afl) {
rlen = read(afl->cmplog_fsrv_st_fd, &status, 4); rlen = read(afl->cmplog_fsrv_st_fd, &status, 4);
} }
} else { } else {
rlen = read(afl->cmplog_fsrv_st_fd, &status, 4); rlen = read(afl->cmplog_fsrv_st_fd, &status, 4);

View File

@ -29,7 +29,8 @@
static int compare_extras_len(const void *p1, const void *p2) { static int compare_extras_len(const void *p1, const void *p2) {
struct extra_data *e1 = (struct extra_data*)p1, *e2 = (struct extra_data*)p2; struct extra_data *e1 = (struct extra_data *)p1,
*e2 = (struct extra_data *)p2;
return e1->len - e2->len; return e1->len - e2->len;
@ -37,7 +38,8 @@ static int compare_extras_len(const void* p1, const void* p2) {
static int compare_extras_use_d(const void *p1, const void *p2) { static int compare_extras_use_d(const void *p1, const void *p2) {
struct extra_data *e1 = (struct extra_data*)p1, *e2 = (struct extra_data*)p2; struct extra_data *e1 = (struct extra_data *)p1,
*e2 = (struct extra_data *)p2;
return e2->hit_cnt - e1->hit_cnt; return e2->hit_cnt - e1->hit_cnt;

View File

@ -181,11 +181,7 @@ u8 run_target(afl_state_t* afl, u32 timeout) {
timer_signal_event.sigev_value.sival_int = afl->fsrv.child_pid; timer_signal_event.sigev_value.sival_int = afl->fsrv.child_pid;
timer_status = timer_create(CLOCK_MONOTONIC, &timer_signal_event, &timer); timer_status = timer_create(CLOCK_MONOTONIC, &timer_signal_event, &timer);
if (timer_status == -1) { if (timer_status == -1) { FATAL("Failed to create Timer"); }
FATAL("Failed to create Timer");
}
timer_period.it_value.tv_sec = (timeout / 1000); timer_period.it_value.tv_sec = (timeout / 1000);
timer_period.it_value.tv_nsec = (timeout % 1000) * 1000000; timer_period.it_value.tv_nsec = (timeout % 1000) * 1000000;
@ -209,7 +205,6 @@ u8 run_target(afl_state_t* afl, u32 timeout) {
} }
/* The SIGALRM handler simply kills the afl->fsrv.child_pid and sets /* The SIGALRM handler simply kills the afl->fsrv.child_pid and sets
* afl->fsrv.child_timed_out. */ * afl->fsrv.child_timed_out. */
@ -221,6 +216,7 @@ u8 run_target(afl_state_t* afl, u32 timeout) {
PFATAL("waitpid() failed"); PFATAL("waitpid() failed");
} }
} else { } else {
s32 res; s32 res;
@ -261,11 +257,7 @@ u8 run_target(afl_state_t* afl, u32 timeout) {
timer_period.it_value.tv_nsec / 1000000); timer_period.it_value.tv_nsec / 1000000);
if (afl->slowest_exec_ms < exec_ms) afl->slowest_exec_ms = exec_ms; if (afl->slowest_exec_ms < exec_ms) afl->slowest_exec_ms = exec_ms;
if (exec_ms >= timeout) { if (exec_ms >= timeout) { afl->fsrv.child_timed_out = 1; }
afl->fsrv.child_timed_out = 1;
}
timer_period.it_value.tv_sec = 0; timer_period.it_value.tv_sec = 0;
timer_period.it_value.tv_nsec = 0; timer_period.it_value.tv_nsec = 0;