Ignore banlist.dat

This also allows to remove the "dirty" argument, which can now be
deduced from the return value of Read().
This commit is contained in:
MarcoFalke
2021-07-28 20:00:23 +02:00
parent 4b1fb50def
commit fa384fdd0b
6 changed files with 13 additions and 18 deletions

View File

@ -52,8 +52,7 @@ FUZZ_TARGET_INIT(banman, initialize_banman)
const bool start_with_corrupted_banlist{fuzzed_data_provider.ConsumeBool()};
bool force_read_and_write_to_err{false};
if (start_with_corrupted_banlist) {
const std::string sfx{fuzzed_data_provider.ConsumeBool() ? ".dat" : ".json"};
assert(WriteBinaryFile(banlist_file.string() + sfx,
assert(WriteBinaryFile(banlist_file.string() + ".json",
fuzzed_data_provider.ConsumeRandomLengthString()));
} else {
force_read_and_write_to_err = fuzzed_data_provider.ConsumeBool();
@ -114,6 +113,5 @@ FUZZ_TARGET_INIT(banman, initialize_banman)
(void)(banmap == banmap_read);
}
}
fs::remove(banlist_file.string() + ".dat");
fs::remove(banlist_file.string() + ".json");
}