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

Function save_ubsan_report

src/program/libfuzzer.rs:777–800  ·  view source on GitHub ↗
(
        fuzzer_dir: &Path,
        ubsan_id: usize,
        corpora: &Path,
        err_msg: &str,
    )

Source from the content-addressed store, hash-verified

775 }
776
777 fn save_ubsan_report(
778 fuzzer_dir: &Path,
779 ubsan_id: usize,
780 corpora: &Path,
781 err_msg: &str,
782 ) -> Result<()> {
783 let fuzzer = get_fuzzer_path(fuzzer_dir);
784 let mut report_dir = fuzzer_dir.to_path_buf();
785 report_dir.push(format!("ubsan_{ubsan_id}"));
786 crate::deopt::utils::create_dir_if_nonexist(&report_dir)?;
787 log::warn!("An valid UBSan report is found! The UBSan report is saved in {report_dir:?}");
788
789 let report_fuzzer = get_fuzzer_path(&report_dir);
790 std::fs::copy(fuzzer, report_fuzzer)?;
791
792 let mut triger_input = report_dir.clone();
793 triger_input.push("triger_input");
794 std::fs::copy(corpora, triger_input).expect(&format!("cannot copy {}", corpora.display()));
795
796 let mut fuzz_log = report_dir.clone();
797 fuzz_log.push("fuzz.log");
798 std::fs::write(fuzz_log, err_msg)?;
799 Ok(())
800 }
801
802 fn sanitize_ubsan_report(fuzzer_entry: &Path, executor: &Executor) -> Result<Vec<String>> {
803 let fuzzer = get_fuzzer_path(fuzzer_entry);

Callers 1

sanitize_ubsan_reportFunction · 0.85

Calls 3

get_fuzzer_pathFunction · 0.85
create_dir_if_nonexistFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected