Determine the maximum number of length extensions to apply to try.
(fuzzer: &Fuzzer)
| 393 | |
| 394 | /// Determine the maximum number of length extensions to apply to try. |
| 395 | fn log2_max_extensions(fuzzer: &Fuzzer) -> u32 { |
| 396 | let max_find_gap = |
| 397 | fuzzer.input_id.map(|id| fuzzer.corpus[id].metadata.max_find_gap).unwrap_or(0); |
| 398 | match max_find_gap { |
| 399 | ..=1000 => 2, |
| 400 | ..=10000 => 3, |
| 401 | ..=100000 => 4, |
| 402 | ..=1000000 => 5, |
| 403 | _ => 6, |
| 404 | } |
| 405 | } |
| 406 | |
| 407 | /// Determine the maximum size of a single extension to try. The idea is to try small extensions |
| 408 | /// first to avoid inputs becoming too large. This number increases the longer it takes to find |