mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-15 11:28:08 +00:00
code format
This commit is contained in:
@ -691,17 +691,26 @@ static void __afl_start_forkserver(void) {
|
||||
|
||||
void (*old_sigchld_handler)(int) = 0; // = signal(SIGCHLD, SIG_DFL);
|
||||
|
||||
if (__afl_map_size <= FS_OPT_MAX_MAPSIZE)
|
||||
if (__afl_map_size <= FS_OPT_MAX_MAPSIZE) {
|
||||
|
||||
status_for_fsrv |= (FS_OPT_SET_MAPSIZE(__afl_map_size) | FS_OPT_MAPSIZE);
|
||||
if (__afl_dictionary_len && __afl_dictionary) status_for_fsrv |= FS_OPT_AUTODICT;
|
||||
if (__afl_sharedmem_fuzzing != 0) status_for_fsrv |= FS_OPT_SHDMEM_FUZZ;
|
||||
if (status_for_fsrv) status_for_fsrv |= (FS_OPT_ENABLED);
|
||||
|
||||
}
|
||||
|
||||
if (__afl_dictionary_len && __afl_dictionary) {
|
||||
|
||||
status_for_fsrv |= FS_OPT_AUTODICT;
|
||||
|
||||
}
|
||||
|
||||
if (__afl_sharedmem_fuzzing != 0) { status_for_fsrv |= FS_OPT_SHDMEM_FUZZ; }
|
||||
if (status_for_fsrv) { status_for_fsrv |= (FS_OPT_ENABLED); }
|
||||
memcpy(tmp, &status_for_fsrv, 4);
|
||||
|
||||
/* Phone home and tell the parent that we're OK. If parent isn't there,
|
||||
assume we're not running in forkserver mode and just execute program. */
|
||||
|
||||
if (write(FORKSRV_FD + 1, tmp, 4) != 4) return;
|
||||
if (write(FORKSRV_FD + 1, tmp, 4) != 4) { return; }
|
||||
|
||||
if (__afl_sharedmem_fuzzing || (__afl_dictionary_len && __afl_dictionary)) {
|
||||
|
||||
|
@ -106,6 +106,7 @@ bool CompareTransform::transformCmps(Module &M, const bool processStrcmp,
|
||||
FunctionCallee tolowerFn;
|
||||
#endif
|
||||
{
|
||||
|
||||
#if LLVM_VERSION_MAJOR < 9
|
||||
Constant *
|
||||
#else
|
||||
@ -122,7 +123,9 @@ bool CompareTransform::transformCmps(Module &M, const bool processStrcmp,
|
||||
#else
|
||||
tolowerFn = c;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
/* iterate over all functions, bbs and instruction and add suitable calls to
|
||||
* strcmp/memcmp/strncmp/strcasecmp/strncasecmp */
|
||||
for (auto &F : M) {
|
||||
|
@ -121,9 +121,12 @@ char compiler_mode_string[7][12] = {
|
||||
u8 *getthecwd() {
|
||||
|
||||
if (getcwd(cwd, sizeof(cwd)) == NULL) {
|
||||
|
||||
static u8 fail[] = "";
|
||||
return fail;
|
||||
|
||||
}
|
||||
|
||||
return cwd;
|
||||
|
||||
}
|
||||
|
@ -446,7 +446,8 @@ static void try_to_add_to_dict(afl_state_t *afl, u64 v, u8 shape) {
|
||||
u32 k;
|
||||
u8 cons_ff = 0, cons_0 = 0;
|
||||
|
||||
if (shape > sizeof(v)) FATAL("shape is greater than %zu, please report!", sizeof(v));
|
||||
if (shape > sizeof(v))
|
||||
FATAL("shape is greater than %zu, please report!", sizeof(v));
|
||||
|
||||
for (k = 0; k < shape; ++k) {
|
||||
|
||||
|
@ -299,7 +299,8 @@ int main(int argc, char **argv_orig, char **envp) {
|
||||
|
||||
s32 opt, i, auto_sync = 0 /*, user_set_cache = 0*/;
|
||||
u64 prev_queued = 0;
|
||||
u32 sync_interval_cnt = 0, seek_to = 0, show_help = 0, map_size = get_map_size();
|
||||
u32 sync_interval_cnt = 0, seek_to = 0, show_help = 0,
|
||||
map_size = get_map_size();
|
||||
u8 *extras_dir[4];
|
||||
u8 mem_limit_given = 0, exit_1 = 0, debug = 0,
|
||||
extras_dir_cnt = 0 /*, have_p = 0*/;
|
||||
|
Reference in New Issue
Block a user