Changeset View
Changeset View
Standalone View
Standalone View
src/test/fuzz/deserialize.cpp
Show All 16 Lines | |||||
#include <version.h> | #include <version.h> | ||||
#include <test/fuzz/fuzz.h> | #include <test/fuzz/fuzz.h> | ||||
#include <cstdint> | #include <cstdint> | ||||
#include <unistd.h> | #include <unistd.h> | ||||
#include <vector> | #include <vector> | ||||
void test_one_input(std::vector<uint8_t> buffer) { | void test_one_input(const std::vector<uint8_t> &buffer) { | ||||
CDataStream ds(buffer, SER_NETWORK, INIT_PROTO_VERSION); | CDataStream ds(buffer, SER_NETWORK, INIT_PROTO_VERSION); | ||||
try { | try { | ||||
int nVersion; | int nVersion; | ||||
ds >> nVersion; | ds >> nVersion; | ||||
ds.SetVersion(nVersion); | ds.SetVersion(nVersion); | ||||
} catch (const std::ios_base::failure &e) { | } catch (const std::ios_base::failure &e) { | ||||
return; | return; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 151 Lines • Show Last 20 Lines |