Skip to content

Commit

Permalink
Fix bug when writing corpus file in the first time.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 724310117
  • Loading branch information
FuzzTest Team authored and copybara-github committed Feb 10, 2025
1 parent af84f4c commit 3fef4bd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions centipede/centipede.cc
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@ void Centipede::CorpusFromFiles(const Environment &env, std::string_view dir) {
existing_hashes.insert(Hash(blob));
}
}
// At this point, it is possible that the workdir is not created yet, so
// we create it here.
const std::string corpus_dir =
std::filesystem::path(corpus_file_path).remove_filename();
CHECK_OK(RemoteMkdir(corpus_dir));
// Add inputs to the current shard, if the shard doesn't have them already.
auto appender = DefaultBlobFileWriterFactory(env.riegeli);
CHECK_OK(appender->Open(corpus_file_path, "a"))
Expand Down

0 comments on commit 3fef4bd

Please sign in to comment.