code format

This commit is contained in:
vanhauser-thc
2025-04-10 09:30:18 +02:00
parent c71d487a4c
commit 6cbe58ff55
3 changed files with 20 additions and 7 deletions

View File

@ -52,6 +52,7 @@ void simplify_trace(afl_state_t *afl, u8 *bytes) {
}
inline void classify_counts(afl_forkserver_t *fsrv) {
u32 *mem = (u32 *)fsrv->trace_bits;
u32 i = (fsrv->map_size >> 2);
@ -64,6 +65,7 @@ inline void classify_counts(afl_forkserver_t *fsrv) {
mem++;
}
}
/* Updates the virgin bits, then reflects whether a new count or a new tuple is

View File

@ -62,6 +62,7 @@ void simplify_trace(afl_state_t *afl, u8 *bytes) {
}
inline void classify_counts(afl_forkserver_t *fsrv) {
u64 *mem = (u64 *)fsrv->trace_bits;
u32 i = (fsrv->map_size >> 3);
@ -74,6 +75,7 @@ inline void classify_counts(afl_forkserver_t *fsrv) {
mem++;
}
}
/* Updates the virgin bits, then reflects whether a new count or a new tuple is

View File

@ -468,6 +468,7 @@ void write_crash_readme(afl_state_t *afl) {
u8 __attribute__((hot)) save_if_interesting(afl_state_t *afl, void *mem,
u32 len, u8 fault) {
u8 classified = 0;
if (unlikely(len == 0)) { return 0; }
@ -559,9 +560,12 @@ u8 __attribute__((hot)) save_if_interesting(afl_state_t *afl, void *mem,
// Note: SAND was evaluated under FAST schedule but should also work
// with other scedules.
if (!classified) {
classify_counts(&afl->fsrv);
classified = 1;
}
cksum_unique =
hash32(afl->fsrv.trace_bits, afl->fsrv.map_size, HASH_CONST);
if (unlikely(!bitmap_read(afl->n_fuzz_dup, cksum) &&
@ -625,11 +629,16 @@ u8 __attribute__((hot)) save_if_interesting(afl_state_t *afl, void *mem,
/* If we are in coverage increasing abstraction and have fed input to
sanitizers, we are sure it has new bits.*/
if (classified) {
/* We could have classified the bits in SAND with UNIQUE_TRACE */
new_bits = has_new_bits(afl, afl->virgin_bits);
} else {
new_bits = has_new_bits_unclassified(afl, afl->virgin_bits);
}
}
if (likely(!new_bits)) {