mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-13 18:48:08 +00:00
no more (?) statics
This commit is contained in:
@ -55,6 +55,8 @@ void load_extras_file(afl_state_t *afl, u8 *fname, u32 *min_len, u32 *max_len,
|
||||
u8 * lptr;
|
||||
u32 cur_line = 0;
|
||||
|
||||
u8 int_bufs[2][16];
|
||||
|
||||
f = fopen(fname, "r");
|
||||
|
||||
if (!f) PFATAL("Unable to open '%s'", fname);
|
||||
@ -170,8 +172,9 @@ void load_extras_file(afl_state_t *afl, u8 *fname, u32 *min_len, u32 *max_len,
|
||||
afl->extras[afl->extras_cnt].len = klen;
|
||||
|
||||
if (afl->extras[afl->extras_cnt].len > MAX_DICT_FILE)
|
||||
FATAL("Keyword too big in line %u (%s, limit is %s)", cur_line, DMS(klen),
|
||||
DMS(MAX_DICT_FILE));
|
||||
FATAL("Keyword too big in line %u (%s, limit is %s)", cur_line,
|
||||
DMS(int_bufs[0], sizeof(int_bufs[0]), klen),
|
||||
DMS(int_bufs[1], sizeof(int_bufs[1]), MAX_DICT_FILE));
|
||||
|
||||
if (*min_len > klen) *min_len = klen;
|
||||
if (*max_len < klen) *max_len = klen;
|
||||
@ -193,6 +196,8 @@ void load_extras(afl_state_t *afl, u8 *dir) {
|
||||
u32 min_len = MAX_DICT_FILE, max_len = 0, dict_level = 0;
|
||||
u8 * x;
|
||||
|
||||
u8 int_bufs[2][16];
|
||||
|
||||
/* If the name ends with @, extract level and continue. */
|
||||
|
||||
if ((x = strchr(dir, '@'))) {
|
||||
@ -238,8 +243,9 @@ void load_extras(afl_state_t *afl, u8 *dir) {
|
||||
}
|
||||
|
||||
if (st.st_size > MAX_DICT_FILE)
|
||||
FATAL("Extra '%s' is too big (%s, limit is %s)", fn, DMS(st.st_size),
|
||||
DMS(MAX_DICT_FILE));
|
||||
FATAL("Extra '%s' is too big (%s, limit is %s)", fn,
|
||||
DMS(int_bufs[0], sizeof(int_bufs[0]), st.st_size),
|
||||
DMS(int_bufs[1], sizeof(int_bufs[1]), MAX_DICT_FILE));
|
||||
|
||||
if (min_len > st.st_size) min_len = st.st_size;
|
||||
if (max_len < st.st_size) max_len = st.st_size;
|
||||
@ -273,11 +279,12 @@ check_and_sort:
|
||||
compare_extras_len);
|
||||
|
||||
OKF("Loaded %u extra tokens, size range %s to %s.", afl->extras_cnt,
|
||||
DMS(min_len), DMS(max_len));
|
||||
DMS(int_bufs[0], sizeof(int_bufs[0]), min_len),
|
||||
DMS(int_bufs[1], sizeof(int_bufs[1]), max_len));
|
||||
|
||||
if (max_len > 32)
|
||||
WARNF("Some tokens are relatively large (%s) - consider trimming.",
|
||||
DMS(max_len));
|
||||
DMS(int_bufs[0], sizeof(int_bufs[0]), max_len));
|
||||
|
||||
if (afl->extras_cnt > MAX_DET_EXTRAS)
|
||||
WARNF("More than %d tokens - will use them probabilistically.",
|
||||
|
Reference in New Issue
Block a user