staterestore File::open should be File::create (#235)

This commit is contained in:
s1341 2021-07-22 12:38:43 +03:00 committed by GitHub
parent 90b7ae08d6
commit 5156b4cf8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,7 +79,7 @@ where
let filename = format!("{:016x}.libafl_state", hasher.finish()); let filename = format!("{:016x}.libafl_state", hasher.finish());
let tmpfile = temp_dir().join(&filename); let tmpfile = temp_dir().join(&filename);
File::open(tmpfile)?.write_all(&serialized)?; File::create(tmpfile)?.write_all(&serialized)?;
// write the filename to shmem // write the filename to shmem
let filename_buf = postcard::to_allocvec(&filename)?; let filename_buf = postcard::to_allocvec(&filename)?;