mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Use spans of std::byte in serialize
This switches .read() and .write() to take spans of bytes.
This commit is contained in:
@@ -23,16 +23,16 @@ FUZZ_TARGET(autofile)
|
||||
CallOneOf(
|
||||
fuzzed_data_provider,
|
||||
[&] {
|
||||
std::array<uint8_t, 4096> arr{};
|
||||
std::array<std::byte, 4096> arr{};
|
||||
try {
|
||||
auto_file.read((char*)arr.data(), fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 4096));
|
||||
auto_file.read({arr.data(), fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 4096)});
|
||||
} catch (const std::ios_base::failure&) {
|
||||
}
|
||||
},
|
||||
[&] {
|
||||
const std::array<uint8_t, 4096> arr{};
|
||||
const std::array<std::byte, 4096> arr{};
|
||||
try {
|
||||
auto_file.write((const char*)arr.data(), fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 4096));
|
||||
auto_file.write({arr.data(), fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 4096)});
|
||||
} catch (const std::ios_base::failure&) {
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user