Dear all:
I am reading the source code of AFL, and I am confused about the "depth" of a testcase(or queue_entry )
The definition of cur_depth is as follow:
EXP_ST u32 queued_paths, /* Total number of queued testcases */
queued_variable, /* Testcases with variable behavior */
queued_at_start, /* Total number of initial inputs */
queued_discovered, /* Items discovered during this run */
queued_imported, /* Items imported via -S */
queued_favored, /* Paths deemed favorable */
queued_with_cov, /* Paths with new coverage bytes */
pending_not_fuzzed, /* Queued but not done yet */
pending_favored, /* Pending favored paths */
cur_skipped_paths, /* Abandoned inputs in cur cycle */
cur_depth, /* Current path depth */
max_depth, /* Max path depth */
And the q->depth is initialized in function "add_to_queue()".
static void add_to_queue(u8* fname, u32 len, u8 passed_det) {
struct queue_entry* q = ck_alloc(sizeof(struct queue_entry));
q->fname = fname;
q->len = len;
q->depth = cur_depth + 1;
......
}
cur_depth is assigned in function "fuzz_one()":
cur_depth = queue_cur->depth;
My question is: what's the meaning of depth of a queue_entry ?
Do it mean the blocks length from the main entry ? or the depth in the queue ?