MCPcopy Create free account
hub / github.com/FuzzAnything/PromptFuzz / mask_driver_from_fuzzer

Function mask_driver_from_fuzzer

src/program/libfuzzer.rs:520–529  ·  view source on GitHub ↗
(fuzzer_path: &Path, driver_id: u16)

Source from the content-addressed store, hash-verified

518}
519
520fn mask_driver_from_fuzzer(fuzzer_path: &Path, driver_id: u16) -> Result<()> {
521 let mut content = std::fs::read_to_string(fuzzer_path)?;
522 let crashed_branch = format!("return LLVMFuzzerTestOneInput_{driver_id}(");
523 if let Some(idx) = content.find(&crashed_branch) {
524 content.insert_str(idx, "//");
525 std::fs::write(fuzzer_path, &content)?;
526 return Ok(());
527 }
528 eyre::bail!("Unable to find the crashed branch: {crashed_branch}\n")
529}
530
531// save the fuzzer and triger input that enables to reproduce this incident
532fn save_the_incident(

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected