aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2021-01-04 23:13:56 +0100
committervan Hauser <vh@thc.org>2021-01-04 23:13:56 +0100
commit6c095b3937565e0e3c645cab706269e8c764701e (patch)
tree9601020625edc4c311e4fa1656651cdb74f767a5 /src
parentd367b033a206187b9342c8003512512f62ff99b0 (diff)
downloadafl++-6c095b3937565e0e3c645cab706269e8c764701e.tar.gz
code format
Diffstat (limited to 'src')
-rw-r--r--src/afl-cc.c15
-rw-r--r--src/afl-fuzz-bitmap.c2
-rw-r--r--src/afl-fuzz-extras.c2
-rw-r--r--src/afl-fuzz-mutators.c2
-rw-r--r--src/afl-fuzz-queue.c2
-rw-r--r--src/afl-fuzz-redqueen.c7
-rw-r--r--src/afl-fuzz-run.c2
-rw-r--r--src/afl-fuzz-stats.c2
-rw-r--r--src/afl-fuzz.c5
-rw-r--r--src/afl-ld-lto.c4
-rw-r--r--src/afl-showmap.c6
11 files changed, 27 insertions, 22 deletions
diff --git a/src/afl-cc.c b/src/afl-cc.c
index 180ab3c4..db2dcd14 100644
--- a/src/afl-cc.c
+++ b/src/afl-cc.c
@@ -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;
}
@@ -1451,11 +1454,11 @@ int main(int argc, char **argv, char **envp) {
"of afl-cc.\n\n");
#if LLVM_MAJOR > 10 || (LLVM_MAJOR == 10 && LLVM_MINOR > 0)
-#define NATIVE_MSG \
- " NATIVE: use llvm's native PCGUARD instrumentation (less " \
- "performant)\n"
+ #define NATIVE_MSG \
+ " NATIVE: use llvm's native PCGUARD instrumentation (less " \
+ "performant)\n"
#else
-#define NATIVE_MSG ""
+ #define NATIVE_MSG ""
#endif
SAYF(
@@ -1463,7 +1466,7 @@ int main(int argc, char **argv, char **envp) {
"available)\n"
" PCGUARD: Dominator tree instrumentation (best!) (README.llvm.md)\n"
- NATIVE_MSG
+ NATIVE_MSG
" CLASSIC: decision target instrumentation (README.llvm.md)\n"
" CTX: CLASSIC + callee context (instrumentation/README.ctx.md)\n"
@@ -1635,7 +1638,7 @@ int main(int argc, char **argv, char **envp) {
if (!instrument_mode) {
instrument_mode = INSTRUMENT_CFG;
- //ptr = instrument_mode_string[instrument_mode];
+ // ptr = instrument_mode_string[instrument_mode];
}
diff --git a/src/afl-fuzz-bitmap.c b/src/afl-fuzz-bitmap.c
index 85a01f98..ed8c2510 100644
--- a/src/afl-fuzz-bitmap.c
+++ b/src/afl-fuzz-bitmap.c
@@ -703,7 +703,7 @@ save_if_interesting(afl_state_t *afl, void *mem, u32 len, u8 fault) {
if (!classified) {
classify_counts(&afl->fsrv);
-// classified = 1;
+ // classified = 1;
}
diff --git a/src/afl-fuzz-extras.c b/src/afl-fuzz-extras.c
index 04f0878c..a3583651 100644
--- a/src/afl-fuzz-extras.c
+++ b/src/afl-fuzz-extras.c
@@ -450,7 +450,7 @@ void add_extra(afl_state_t *afl, u8 *mem, u32 len) {
if (len > MAX_DICT_FILE) {
- u8 val_bufs[2][STRINGIFY_VAL_SIZE_MAX];
+ u8 val_bufs[2][STRINGIFY_VAL_SIZE_MAX];
WARNF("Extra '%.*s' is too big (%s, limit is %s), skipping file!", (int)len,
mem, stringify_mem_size(val_bufs[0], sizeof(val_bufs[0]), len),
stringify_mem_size(val_bufs[1], sizeof(val_bufs[1]), MAX_DICT_FILE));
diff --git a/src/afl-fuzz-mutators.c b/src/afl-fuzz-mutators.c
index 5da692d3..089707b9 100644
--- a/src/afl-fuzz-mutators.c
+++ b/src/afl-fuzz-mutators.c
@@ -324,7 +324,7 @@ u8 trim_case_custom(afl_state_t *afl, struct queue_entry *q, u8 *in_buf,
} else {
afl->stage_max = retval;
-
+
}
if (afl->not_on_tty && afl->debug) {
diff --git a/src/afl-fuzz-queue.c b/src/afl-fuzz-queue.c
index cd41bafc..7b8c039b 100644
--- a/src/afl-fuzz-queue.c
+++ b/src/afl-fuzz-queue.c
@@ -489,7 +489,7 @@ void add_to_queue(afl_state_t *afl, u8 *fname, u32 len, u8 passed_det) {
void destroy_queue(afl_state_t *afl) {
- u32 i;
+ u32 i;
for (i = 0; i < afl->queued_paths; i++) {
diff --git a/src/afl-fuzz-redqueen.c b/src/afl-fuzz-redqueen.c
index 7dba1caa..28585afe 100644
--- a/src/afl-fuzz-redqueen.c
+++ b/src/afl-fuzz-redqueen.c
@@ -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) {
@@ -670,8 +671,8 @@ static u8 rtn_fuzz(afl_state_t *afl, u32 key, u8 *orig_buf, u8 *buf, u32 len) {
u8 status = 0;
// opt not in the paper
-// u32 fails = 0;
- u8 found_one = 0;
+ // u32 fails = 0;
+ u8 found_one = 0;
for (i = 0; i < loggeds; ++i) {
diff --git a/src/afl-fuzz-run.c b/src/afl-fuzz-run.c
index 11d8204b..41557707 100644
--- a/src/afl-fuzz-run.c
+++ b/src/afl-fuzz-run.c
@@ -682,7 +682,7 @@ void sync_fuzzers(afl_state_t *afl) {
// same time. If so, the first temporary main node running again will demote
// themselves so this is not an issue
-// u8 path2[PATH_MAX];
+ // u8 path2[PATH_MAX];
afl->is_main_node = 1;
sprintf(path, "%s/is_main_node", afl->out_dir);
int fd = open(path, O_CREAT | O_RDWR, 0644);
diff --git a/src/afl-fuzz-stats.c b/src/afl-fuzz-stats.c
index c8366174..e86f2aeb 100644
--- a/src/afl-fuzz-stats.c
+++ b/src/afl-fuzz-stats.c
@@ -31,7 +31,7 @@
void write_setup_file(afl_state_t *afl, u32 argc, char **argv) {
- u8 fn[PATH_MAX];
+ u8 fn[PATH_MAX];
snprintf(fn, PATH_MAX, "%s/fuzzer_setup", afl->out_dir);
FILE *f = create_ffile(fn);
u32 i;
diff --git a/src/afl-fuzz.c b/src/afl-fuzz.c
index e239b47f..063134fb 100644
--- a/src/afl-fuzz.c
+++ b/src/afl-fuzz.c
@@ -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*/;
@@ -326,7 +327,7 @@ int main(int argc, char **argv_orig, char **envp) {
if (get_afl_env("AFL_DEBUG")) { debug = afl->debug = 1; }
-// map_size = get_map_size();
+ // map_size = get_map_size();
afl_state_init(afl, map_size);
afl->debug = debug;
afl_fsrv_init(&afl->fsrv);
diff --git a/src/afl-ld-lto.c b/src/afl-ld-lto.c
index 1d54fda0..7a4d9132 100644
--- a/src/afl-ld-lto.c
+++ b/src/afl-ld-lto.c
@@ -252,8 +252,8 @@ static void edit_params(int argc, char **argv) {
int main(int argc, char **argv) {
- s32 pid, i, status;
-// u8 * ptr;
+ s32 pid, i, status;
+ // u8 * ptr;
char thecwd[PATH_MAX];
if (getenv("AFL_LD_CALLER") != NULL) {
diff --git a/src/afl-showmap.c b/src/afl-showmap.c
index c0223a07..d50601fc 100644
--- a/src/afl-showmap.c
+++ b/src/afl-showmap.c
@@ -1014,9 +1014,9 @@ int main(int argc, char **argv_orig, char **envp) {
DIR * dir_in, *dir_out = NULL;
struct dirent *dir_ent;
-// int done = 0;
- u8 infile[PATH_MAX], outfile[PATH_MAX];
- u8 wait_for_gdb = 0;
+ // int done = 0;
+ u8 infile[PATH_MAX], outfile[PATH_MAX];
+ u8 wait_for_gdb = 0;
#if !defined(DT_REG)
struct stat statbuf;
#endif