mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-01 00:34:01 +02:00
Use spans of std::byte in serialize
This switches .read() and .write() to take spans of bytes.
This commit is contained in:
@@ -33,9 +33,9 @@ FUZZ_TARGET(buffered_file)
|
||||
CallOneOf(
|
||||
fuzzed_data_provider,
|
||||
[&] {
|
||||
std::array<uint8_t, 4096> arr{};
|
||||
std::array<std::byte, 4096> arr{};
|
||||
try {
|
||||
opt_buffered_file->read((char*)arr.data(), fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 4096));
|
||||
opt_buffered_file->read({arr.data(), fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 4096)});
|
||||
} catch (const std::ios_base::failure&) {
|
||||
}
|
||||
},
|
||||
@@ -53,7 +53,7 @@ FUZZ_TARGET(buffered_file)
|
||||
return;
|
||||
}
|
||||
try {
|
||||
opt_buffered_file->FindByte(fuzzed_data_provider.ConsumeIntegral<char>());
|
||||
opt_buffered_file->FindByte(fuzzed_data_provider.ConsumeIntegral<uint8_t>());
|
||||
} catch (const std::ios_base::failure&) {
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user