unified pointer placement
MODIFY
.clang-format
.clang-format
@@ -52,7 +52,7 @@ ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
-DerivePointerAlignment: true
+DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true

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

MODIFY
src/afl-fuzz-cmplog.c
src/afl-fuzz-cmplog.c
@@ -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_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) {
@@ -201,6 +202,7 @@ void init_cmplog_forkserver(afl_state_t *afl) {
rlen = read(afl->cmplog_fsrv_st_fd, &status, 4);
}
+
} else {
rlen = read(afl->cmplog_fsrv_st_fd, &status, 4);

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

MODIFY
src/afl-fuzz-run.c
src/afl-fuzz-run.c
@@ -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_status = timer_create(CLOCK_MONOTONIC, &timer_signal_event, &timer);
- if (timer_status == -1) {
-
- FATAL("Failed to create Timer");
-
- }
+ if (timer_status == -1) { FATAL("Failed to create Timer"); }
timer_period.it_value.tv_sec = (timeout / 1000);
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
* afl->fsrv.child_timed_out. */
@@ -221,6 +216,7 @@ u8 run_target(afl_state_t* afl, u32 timeout) {
PFATAL("waitpid() failed");
}
+
} else {
s32 res;
@@ -261,11 +257,7 @@ u8 run_target(afl_state_t* afl, u32 timeout) {
timer_period.it_value.tv_nsec / 1000000);
if (afl->slowest_exec_ms < exec_ms) afl->slowest_exec_ms = exec_ms;
- if (exec_ms >= timeout) {
-
- afl->fsrv.child_timed_out = 1;
-
- }
+ if (exec_ms >= timeout) { afl->fsrv.child_timed_out = 1; }
timer_period.it_value.tv_sec = 0;
timer_period.it_value.tv_nsec = 0;

unified pointer placement