mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-17 20:28:08 +00:00
fix for clang
This commit is contained in:
@ -1231,7 +1231,7 @@ inline u32 afl_mutate(afl_state_t *afl, u8 *buf, u32 len, u32 steps,
|
|||||||
|
|
||||||
for (u32 step = 0; step < steps; ++step) {
|
for (u32 step = 0; step < steps; ++step) {
|
||||||
|
|
||||||
retry_havoc_step:
|
retry_havoc_step : {
|
||||||
|
|
||||||
u32 r = rand_below(afl, MUT_STRATEGY_ARRAY_SIZE), item;
|
u32 r = rand_below(afl, MUT_STRATEGY_ARRAY_SIZE), item;
|
||||||
|
|
||||||
@ -1667,10 +1667,10 @@ inline u32 afl_mutate(afl_state_t *afl, u8 *buf, u32 len, u32 steps,
|
|||||||
|
|
||||||
if (unlikely(len < 4)) { break; } // no retry
|
if (unlikely(len < 4)) { break; } // no retry
|
||||||
|
|
||||||
u32 len = choose_block_len(afl, len - 1);
|
u32 blen = choose_block_len(afl, len - 1);
|
||||||
u32 off = rand_below(afl, len - len + 1);
|
u32 off = rand_below(afl, len - blen + 1);
|
||||||
|
|
||||||
for (u32 i = len - 1; i > 0; i--) {
|
for (u32 i = blen - 1; i > 0; i--) {
|
||||||
|
|
||||||
u32 j;
|
u32 j;
|
||||||
do {
|
do {
|
||||||
@ -2030,6 +2030,8 @@ inline u32 afl_mutate(afl_state_t *afl, u8 *buf, u32 len, u32 steps,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return len;
|
return len;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2139,8 +2139,8 @@ havoc_stage:
|
|||||||
|
|
||||||
LIST_FOREACH(&afl->custom_mutator_list, struct custom_mutator, {
|
LIST_FOREACH(&afl->custom_mutator_list, struct custom_mutator, {
|
||||||
|
|
||||||
if (el->stacked_custom &&
|
if (unlikely(el->stacked_custom &&
|
||||||
rand_below(afl, 100) < el->stacked_custom_prob) {
|
rand_below(afl, 100) < el->stacked_custom_prob)) {
|
||||||
|
|
||||||
u8 *custom_havoc_buf = NULL;
|
u8 *custom_havoc_buf = NULL;
|
||||||
size_t new_len = el->afl_custom_havoc_mutation(
|
size_t new_len = el->afl_custom_havoc_mutation(
|
||||||
@ -2170,7 +2170,8 @@ havoc_stage:
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
retry_havoc_step:
|
retry_havoc_step : {
|
||||||
|
|
||||||
u32 r = rand_below(afl, MUT_STRATEGY_ARRAY_SIZE), item;
|
u32 r = rand_below(afl, MUT_STRATEGY_ARRAY_SIZE), item;
|
||||||
|
|
||||||
switch (mutation_array[r]) {
|
switch (mutation_array[r]) {
|
||||||
@ -3250,6 +3251,8 @@ havoc_stage:
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if (common_fuzz_stuff(afl, out_buf, temp_len)) { goto abandon_entry; }
|
if (common_fuzz_stuff(afl, out_buf, temp_len)) { goto abandon_entry; }
|
||||||
|
|
||||||
/* out_buf might have been mangled a bit, so let's restore it to its
|
/* out_buf might have been mangled a bit, so let's restore it to its
|
||||||
|
Reference in New Issue
Block a user