mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
fuzz: Avoid extraneous copy of input data, using Span<>
This commit is contained in:
@@ -30,8 +30,6 @@
|
||||
#include <stdint.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <test/fuzz/fuzz.h>
|
||||
|
||||
void initialize_deserialize()
|
||||
@@ -71,7 +69,7 @@ T Deserialize(CDataStream ds)
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void DeserializeFromFuzzingInput(const std::vector<uint8_t>& buffer, T& obj, const Optional<int> protocol_version = nullopt)
|
||||
void DeserializeFromFuzzingInput(FuzzBufferType buffer, T& obj, const Optional<int> protocol_version = nullopt)
|
||||
{
|
||||
CDataStream ds(buffer, SER_NETWORK, INIT_PROTO_VERSION);
|
||||
if (protocol_version) {
|
||||
|
||||
Reference in New Issue
Block a user