Skip to content

Commit

Permalink
report bug idxs (#404)
Browse files Browse the repository at this point in the history
  • Loading branch information
shouc authored Dec 7, 2023
1 parent 069ac88 commit 46cf4f3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/fuzzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -586,9 +586,8 @@ where
let vulns_dir = format!("{}/vulnerabilities", self.work_dir.as_str());

if !unsafe { REPLAY } {
unsafe {
DUMP_FILE_COUNT += 1;
}
let bug_idxs =
unsafe { ORACLE_OUTPUT.iter().map(|v| v["bug_idx"].as_u64().unwrap()).join(",") };
let data = format!(
"Reverted? {} \n Txn: {}",
state.get_execution_result().reverted,
Expand All @@ -599,10 +598,10 @@ where
if !path.exists() {
std::fs::create_dir_all(path).unwrap();
}
let mut file = File::create(format!("{}/{}", vulns_dir, unsafe { DUMP_FILE_COUNT })).unwrap();
let mut file = File::create(format!("{}/{}", vulns_dir, bug_idxs.clone())).unwrap();
file.write_all(data.as_bytes()).unwrap();
let mut replayable_file =
File::create(format!("{}/{}_replayable", vulns_dir, unsafe { DUMP_FILE_COUNT })).unwrap();
File::create(format!("{}/{}_replayable", vulns_dir, bug_idxs)).unwrap();
replayable_file.write_all(txn_json.as_bytes()).unwrap();
}
// dump_file!(state, vulns_dir, false);
Expand Down

0 comments on commit 46cf4f3

Please sign in to comment.