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

Method clone_programs

src/program/libfuzzer.rs:89–101  ·  view source on GitHub ↗

clone the programs to a tmp directory. avoid to edit the raw programs.

(&self)

Source from the content-addressed store, hash-verified

87 // clone the programs to a tmp directory.
88 // avoid to edit the raw programs.
89 fn clone_programs(&self) -> Result<Vec<PathBuf>> {
90 let mut new_programs = Vec::new();
91
92 let tmp_dir = self.deopt.get_library_driver_dir()?;
93 for (id, program) in self.programs.iter().enumerate() {
94 let mut dst_path = tmp_dir.clone();
95 dst_path.push(format!("id_{number:>0width$}.cc", number = id, width = 6));
96 std::fs::copy(program, &dst_path)
97 .context(format!("Unable to copy {program:?} to {dst_path:?}"))?;
98 new_programs.push(dst_path);
99 }
100 Ok(new_programs)
101 }
102
103 pub fn transform(&mut self) -> Result<()> {
104 self.init()?;

Callers 1

transformMethod · 0.80

Calls 2

pushMethod · 0.45

Tested by

no test coverage detected