code-format

This commit is contained in:
Dominik Maier
2020-08-14 00:46:48 +02:00
parent 83df65a66b
commit 69f8c62955
4 changed files with 8 additions and 7 deletions

View File

@ -89,7 +89,7 @@ typedef struct afl_forkserver {
/* Function to kick off the forkserver child */ /* Function to kick off the forkserver child */
void (*init_child_func)(struct afl_forkserver *fsrv, char **argv); void (*init_child_func)(struct afl_forkserver *fsrv, char **argv);
u8 *afl_ptr; /* for autodictionary: afl ptr */ u8 *afl_ptr; /* for autodictionary: afl ptr */
void (*autodict_func)(void *afl_ptr, u8 *mem, u32 len); void (*autodict_func)(void *afl_ptr, u8 *mem, u32 len);

View File

@ -324,8 +324,8 @@ static void report_error_and_exit(int error) {
cloning a stopped child. So, we just execute once, and then send commands cloning a stopped child. So, we just execute once, and then send commands
through a pipe. The other part of this logic is in afl-as.h / llvm_mode */ through a pipe. The other part of this logic is in afl-as.h / llvm_mode */
void afl_fsrv_start(afl_forkserver_t *fsrv, char **argv, volatile u8 *stop_soon_p, void afl_fsrv_start(afl_forkserver_t *fsrv, char **argv,
u8 debug_child_output) { volatile u8 *stop_soon_p, u8 debug_child_output) {
int st_pipe[2], ctl_pipe[2]; int st_pipe[2], ctl_pipe[2];
s32 status; s32 status;
@ -642,6 +642,7 @@ void afl_fsrv_start(afl_forkserver_t *fsrv, char **argv, volatile u8 *stop_soon_
status = (FS_OPT_ENABLED); status = (FS_OPT_ENABLED);
} }
if (write(fsrv->fsrv_ctl_fd, &status, 4) != 4) { if (write(fsrv->fsrv_ctl_fd, &status, 4) != 4) {
FATAL("Writing to forkserver failed."); FATAL("Writing to forkserver failed.");
@ -658,7 +659,7 @@ void afl_fsrv_start(afl_forkserver_t *fsrv, char **argv, volatile u8 *stop_soon_
status = (FS_OPT_ENABLED | FS_OPT_AUTODICT | FS_OPT_SHDMEM_FUZZ); status = (FS_OPT_ENABLED | FS_OPT_AUTODICT | FS_OPT_SHDMEM_FUZZ);
} else { } else {
status = (FS_OPT_ENABLED | FS_OPT_AUTODICT); status = (FS_OPT_ENABLED | FS_OPT_AUTODICT);
@ -715,7 +716,7 @@ void afl_fsrv_start(afl_forkserver_t *fsrv, char **argv, volatile u8 *stop_soon_
(u8)dict[offset] + offset < (u32)status) { (u8)dict[offset] + offset < (u32)status) {
fsrv->autodict_func(fsrv->afl_ptr, dict + offset + 1, fsrv->autodict_func(fsrv->afl_ptr, dict + offset + 1,
(u8)dict[offset]); (u8)dict[offset]);
offset += (1 + dict[offset]); offset += (1 + dict[offset]);
count++; count++;

View File

@ -357,7 +357,7 @@ static inline u8 memcmp_nocase(u8 *m1, u8 *m2, u32 len) {
void maybe_add_auto(afl_state_t *afl, u8 *mem, u32 len) { void maybe_add_auto(afl_state_t *afl, u8 *mem, u32 len) {
u32 i; u32 i;
/* Allow users to specify that they don't want auto dictionaries. */ /* Allow users to specify that they don't want auto dictionaries. */

View File

@ -114,7 +114,7 @@ void afl_state_init(afl_state_t *afl, uint32_t map_size) {
afl->fsrv.map_size = map_size; afl->fsrv.map_size = map_size;
// afl_state_t is not available in forkserver.c // afl_state_t is not available in forkserver.c
afl->fsrv.afl_ptr = (void *)afl; afl->fsrv.afl_ptr = (void *)afl;
afl->fsrv.autodict_func = (void (*)(void *, u8 *, u32))&maybe_add_auto; afl->fsrv.autodict_func = (void (*)(void *, u8 *, u32)) & maybe_add_auto;
afl->cal_cycles = CAL_CYCLES; afl->cal_cycles = CAL_CYCLES;
afl->cal_cycles_long = CAL_CYCLES_LONG; afl->cal_cycles_long = CAL_CYCLES_LONG;