Determine the maximum size of a single extension to try. The idea is to try small extensions first to avoid inputs becoming too large. This number increases the longer it takes to find new inputs.
(fuzzer: &Fuzzer)
| 408 | /// first to avoid inputs becoming too large. This number increases the longer it takes to find |
| 409 | /// new inputs. |
| 410 | fn extension_limit(fuzzer: &Fuzzer) -> usize { |
| 411 | let max_find_gap = |
| 412 | fuzzer.input_id.map(|id| fuzzer.corpus[id].metadata.max_find_gap).unwrap_or(0); |
| 413 | if max_find_gap < 0x1000 { |
| 414 | return 32; |
| 415 | } |
| 416 | max_find_gap.next_power_of_two().min(0x10000) as usize |
| 417 | } |