code-format, changelog

This commit is contained in:
Dominik Maier
2020-08-18 01:36:49 +02:00
parent 1a94cfe2af
commit b504b9313a
4 changed files with 13 additions and 18 deletions

View File

@ -22,6 +22,7 @@ sending a mail to <afl-users+subscribe@googlegroups.com>.
- expanded havoc mode added, on no cycle finds add extra splicing and - expanded havoc mode added, on no cycle finds add extra splicing and
MOpt into the mix MOpt into the mix
- fixed a bug in redqueen for strings and made deterministic with -s - fixed a bug in redqueen for strings and made deterministic with -s
- Compiletime autodictionary fixes
- llvm_mode: - llvm_mode:
- now supports llvm 12! - now supports llvm 12!
- support for AFL_LLVM_ALLOWLIST/AFL_LLVM_DENYLIST (previous - support for AFL_LLVM_ALLOWLIST/AFL_LLVM_DENYLIST (previous

View File

@ -716,7 +716,7 @@ void afl_fsrv_start(afl_forkserver_t *fsrv, char **argv,
(u8)dict[offset] + offset < (u32)status) { (u8)dict[offset] + offset < (u32)status) {
fsrv->add_extra_func(fsrv->afl_ptr, dict + offset + 1, fsrv->add_extra_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

@ -227,12 +227,12 @@ void load_extras_file(afl_state_t *afl, u8 *fname, u32 *min_len, u32 *max_len,
} }
static void extras_check_and_sort(afl_state_t *afl, u32 min_len, u32 max_len, u8 *dir) { static void extras_check_and_sort(afl_state_t *afl, u32 min_len, u32 max_len,
u8 *dir) {
u8 val_bufs[2][STRINGIFY_VAL_SIZE_MAX]; u8 val_bufs[2][STRINGIFY_VAL_SIZE_MAX];
if (!afl->extras_cnt) { if (!afl->extras_cnt) { FATAL("No usable files in '%s'", dir); }
FATAL("No usable files in '%s'", dir); }
qsort(afl->extras, afl->extras_cnt, sizeof(struct extra_data), qsort(afl->extras, afl->extras_cnt, sizeof(struct extra_data),
compare_extras_len); compare_extras_len);
@ -257,8 +257,6 @@ static void extras_check_and_sort(afl_state_t *afl, u32 min_len, u32 max_len, u8
} }
/* Read extras from the extras directory and sort them by size. */ /* Read extras from the extras directory and sort them by size. */
void load_extras(afl_state_t *afl, u8 *dir) { void load_extras(afl_state_t *afl, u8 *dir) {
@ -379,22 +377,18 @@ void add_extra(afl_state_t *afl, u8 *mem, u32 len) {
if (len > MAX_DICT_FILE) { if (len > MAX_DICT_FILE) {
FATAL( FATAL("Extra '%.*s' is too big (%s, limit is %s)", (int)len, mem,
"Extra '%.*s' is too big (%s, limit is %s)", (int)len, mem, stringify_mem_size(val_bufs[0], sizeof(val_bufs[0]), len),
stringify_mem_size(val_bufs[0], sizeof(val_bufs[0]), len), stringify_mem_size(val_bufs[1], sizeof(val_bufs[1]), MAX_DICT_FILE));
stringify_mem_size(val_bufs[1], sizeof(val_bufs[1]), MAX_DICT_FILE));
} else if (len > 32) { } else if (len > 32) {
WARNF( WARNF("Extra '%.*s' is pretty large, consider trimming.", (int)len, mem);
"Extra '%.*s' is pretty large, consider trimming.", (int)len, mem
);
} }
afl->extras = afl->extras = afl_realloc((void **)&afl->extras,
afl_realloc((void **)&afl->extras, (afl->extras_cnt + 1) * sizeof(struct extra_data));
(afl->extras_cnt + 1) * sizeof(struct extra_data));
if (unlikely(!afl->extras)) { PFATAL("alloc"); } if (unlikely(!afl->extras)) { PFATAL("alloc"); }
afl->extras[afl->extras_cnt].data = ck_alloc(len); afl->extras[afl->extras_cnt].data = ck_alloc(len);
@ -410,7 +404,7 @@ void add_extra(afl_state_t *afl, u8 *mem, u32 len) {
/* We only want to print this once */ /* We only want to print this once */
if (afl->extras_cnt == MAX_DET_EXTRAS + 1) { if (afl->extras_cnt == MAX_DET_EXTRAS + 1) {
WARNF("More than %d tokens - will use them probabilistically.", WARNF("More than %d tokens - will use them probabilistically.",
MAX_DET_EXTRAS); MAX_DET_EXTRAS);

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.add_extra_func = (void (*)(void *, u8 *, u32)) &add_extra; afl->fsrv.add_extra_func = (void (*)(void *, u8 *, u32)) & add_extra;
afl->cal_cycles = CAL_CYCLES; afl->cal_cycles = CAL_CYCLES;
afl->cal_cycles_long = CAL_CYCLES_LONG; afl->cal_cycles_long = CAL_CYCLES_LONG;