format code

This commit is contained in:
yangzao
2023-11-27 09:58:03 -07:00
parent faedb3fb29
commit c9e0f01b43
4 changed files with 34 additions and 34 deletions

View File

@ -1894,6 +1894,7 @@ custom_mutator_stage:
LIST_FOREACH(&afl->custom_mutator_list, struct custom_mutator, { LIST_FOREACH(&afl->custom_mutator_list, struct custom_mutator, {
if (el->afl_custom_fuzz) { if (el->afl_custom_fuzz) {
havoc_queued = afl->queued_items; havoc_queued = afl->queued_items;
afl->current_custom_fuzz = el; afl->current_custom_fuzz = el;

View File

@ -939,9 +939,7 @@ void post_run_py(void *py_mutator) {
py_args = PyTuple_New(0); py_args = PyTuple_New(0);
py_value = PyObject_CallObject( py_value = PyObject_CallObject(
((py_mutator_t *)py_mutator) ((py_mutator_t *)py_mutator)->py_functions[PY_FUNC_POST_RUN], py_args);
->py_functions[PY_FUNC_POST_RUN],
py_args);
Py_DECREF(py_args); Py_DECREF(py_args);
if (py_value != NULL) { if (py_value != NULL) {

View File

@ -1117,16 +1117,15 @@ common_fuzz_stuff(afl_state_t *afl, u8 *out_buf, u32 len) {
with afl-fuzz. */ with afl-fuzz. */
void post_run(afl_state_t *afl) { void post_run(afl_state_t *afl) {
if (unlikely(afl->custom_mutators_count)) { if (unlikely(afl->custom_mutators_count)) {
LIST_FOREACH(&afl->custom_mutator_list, struct custom_mutator, { LIST_FOREACH(&afl->custom_mutator_list, struct custom_mutator, {
if (el->afl_custom_post_run) { if (el->afl_custom_post_run) { el->afl_custom_post_run(el->data); }
el->afl_custom_post_run(el->data); });
} }
}); }
}
}

View File

@ -138,7 +138,7 @@ void load_stats_file(afl_state_t *afl) {
FILE *f; FILE *f;
u8 buf[MAX_LINE]; u8 buf[MAX_LINE];
u8 * lptr; u8 *lptr;
u8 fn[PATH_MAX]; u8 fn[PATH_MAX];
u32 lineno = 0; u32 lineno = 0;
snprintf(fn, PATH_MAX, "%s/fuzzer_stats", afl->out_dir); snprintf(fn, PATH_MAX, "%s/fuzzer_stats", afl->out_dir);
@ -421,7 +421,7 @@ void write_stats_file(afl_state_t *afl, u32 t_bytes, double bitmap_cvg,
void write_queue_stats(afl_state_t *afl) { void write_queue_stats(afl_state_t *afl) {
FILE *f; FILE *f;
u8 * fn = alloc_printf("%s/queue_data", afl->out_dir); u8 *fn = alloc_printf("%s/queue_data", afl->out_dir);
if ((f = fopen(fn, "w")) != NULL) { if ((f = fopen(fn, "w")) != NULL) {
u32 id; u32 id;
@ -857,8 +857,9 @@ void show_stats_normal(afl_state_t *afl) {
/* Since `total_crashes` does not get reloaded from disk on restart, /* Since `total_crashes` does not get reloaded from disk on restart,
it indicates if we found crashes this round already -> paint red. it indicates if we found crashes this round already -> paint red.
If it's 0, but `saved_crashes` is set from a past run, paint in yellow. */ If it's 0, but `saved_crashes` is set from a past run, paint in yellow. */
char *crash_color = char *crash_color = afl->total_crashes ? cLRD
afl->total_crashes ? cLRD : afl->saved_crashes ? cYEL : cRST; : afl->saved_crashes ? cYEL
: cRST;
/* Lord, forgive me this. */ /* Lord, forgive me this. */
@ -881,26 +882,26 @@ void show_stats_normal(afl_state_t *afl) {
} else } else
/* Subsequent cycles, but we're still making finds. */ /* Subsequent cycles, but we're still making finds. */
if (afl->cycles_wo_finds < 25 || min_wo_finds < 30) { if (afl->cycles_wo_finds < 25 || min_wo_finds < 30) {
strcpy(tmp, cYEL); strcpy(tmp, cYEL);
} else } else
/* No finds for a long time and no test cases to try. */ /* No finds for a long time and no test cases to try. */
if (afl->cycles_wo_finds > 100 && !afl->pending_not_fuzzed && if (afl->cycles_wo_finds > 100 && !afl->pending_not_fuzzed &&
min_wo_finds > 120) { min_wo_finds > 120) {
strcpy(tmp, cLGN); strcpy(tmp, cLGN);
/* Default: cautiously OK to stop? */ /* Default: cautiously OK to stop? */
} else { } else {
strcpy(tmp, cLBL); strcpy(tmp, cLBL);
} }
} }
@ -1666,8 +1667,9 @@ void show_stats_pizza(afl_state_t *afl) {
/* Since `total_crashes` does not get reloaded from disk on restart, /* Since `total_crashes` does not get reloaded from disk on restart,
it indicates if we found crashes this round already -> paint red. it indicates if we found crashes this round already -> paint red.
If it's 0, but `saved_crashes` is set from a past run, paint in yellow. */ If it's 0, but `saved_crashes` is set from a past run, paint in yellow. */
char *crash_color = char *crash_color = afl->total_crashes ? cLRD
afl->total_crashes ? cLRD : afl->saved_crashes ? cYEL : cRST; : afl->saved_crashes ? cYEL
: cRST;
/* Lord, forgive me this. */ /* Lord, forgive me this. */
@ -1690,26 +1692,26 @@ void show_stats_pizza(afl_state_t *afl) {
} else } else
/* Subsequent cycles, but we're still making finds. */ /* Subsequent cycles, but we're still making finds. */
if (afl->cycles_wo_finds < 25 || min_wo_finds < 30) { if (afl->cycles_wo_finds < 25 || min_wo_finds < 30) {
strcpy(tmp, cYEL); strcpy(tmp, cYEL);
} else } else
/* No finds for a long time and no test cases to try. */ /* No finds for a long time and no test cases to try. */
if (afl->cycles_wo_finds > 100 && !afl->pending_not_fuzzed && if (afl->cycles_wo_finds > 100 && !afl->pending_not_fuzzed &&
min_wo_finds > 120) { min_wo_finds > 120) {
strcpy(tmp, cLGN); strcpy(tmp, cLGN);
/* Default: cautiously OK to stop? */ /* Default: cautiously OK to stop? */
} else { } else {
strcpy(tmp, cLBL); strcpy(tmp, cLBL);
} }
} }