afl-fuzz.c
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;
  q->current_entry = queued_paths_id;
  q->passed_det   = passed_det;
  q->tc_ref = 0;
  q->tr_list = NULL;

  if (q->depth > max_depth) max_depth = q->depth;

  struct top_mem* top_cur = (struct top_mem *)malloc(sizeof(struct top_mem));
  top_cur->testcase = q;
  top_cur->next = NULL;
  struct top_mem * top_index = cksum_hash_map[4096]->score_queue;
  if(top_index){
    while(top_index->next){
      top_index = top_index->next;
    }
    top_index->next = top_cur;
  }else{
	cksum_hash_map[4096]->score_queue = top_cur;
  }
  cksum_hash_map[4096]->testcase_num++;

  queued_paths_total++;
  pending_not_fuzzed++;
  cycles_wo_finds = 0;

  last_path_time = get_cur_time();

}
/* Append init test case to the queue. */
Append init test case to the queue.
Append init test case to the 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;
  q->current_entry = queued_paths_id;
  q->passed_det   = passed_det;
  q->tc_ref = 0;
  q->tr_list = NULL;
  if (q->depth > max_depth) max_depth = q->depth;
  struct top_mem* top_cur = (struct top_mem *)malloc(sizeof(struct top_mem));
  top_cur->testcase = q;
  top_cur->next = NULL;
  struct top_mem * top_index = cksum_hash_map[4096]->score_queue;
  if(top_index){
    while(top_index->next){
      top_index = top_index->next;
    }
    top_index->next = top_cur;
  }else{
	cksum_hash_map[4096]->score_queue = top_cur;
  }
  cksum_hash_map[4096]->testcase_num++;
  queued_paths_total++;
  pending_not_fuzzed++;
  cycles_wo_finds = 0;
  last_path_time = get_cur_time();
}
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 ; q -> current_entry = queued_paths_id ; q -> passed_det = passed_det ; q -> tc_ref = 0 ; q -> tr_list = NULL ; if ( q -> depth > max_depth ) max_depth = q -> depth ; struct top_mem * top_cur = ( struct top_mem * ) malloc ( sizeof ( struct top_mem ) ) ; top_cur -> testcase = q ; top_cur -> next = NULL ; struct top_mem * top_index = cksum_hash_map [ 4096 ] -> score_queue ; if ( top_index ) { while ( top_index -> next ) { top_index = top_index -> next ; } top_index -> next = top_cur ; } else { cksum_hash_map [ 4096 ] -> score_queue = top_cur ; } cksum_hash_map [ 4096 ] -> testcase_num ++ ; queued_paths_total ++ ; pending_not_fuzzed ++ ; cycles_wo_finds = 0 ; last_path_time = get_cur_time ( ) ; }
Append init test case to the queue.
Append init test case to the queue .