mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 20:03:34 -03:00
fuzz: Avoid negative NodeId in ConsumeNode
This commit is contained in:
parent
205877e55f
commit
fa3583f856
1 changed files with 1 additions and 1 deletions
|
@ -257,7 +257,7 @@ inline CAddress ConsumeAddress(FuzzedDataProvider& fuzzed_data_provider) noexcep
|
|||
template <bool ReturnUniquePtr = false>
|
||||
auto ConsumeNode(FuzzedDataProvider& fuzzed_data_provider, const std::optional<NodeId>& node_id_in = std::nullopt) noexcept
|
||||
{
|
||||
const NodeId node_id = node_id_in.value_or(fuzzed_data_provider.ConsumeIntegral<NodeId>());
|
||||
const NodeId node_id = node_id_in.value_or(fuzzed_data_provider.ConsumeIntegralInRange<NodeId>(0, std::numeric_limits<NodeId>::max()));
|
||||
const ServiceFlags local_services = ConsumeWeakEnum(fuzzed_data_provider, ALL_SERVICE_FLAGS);
|
||||
const SOCKET socket = INVALID_SOCKET;
|
||||
const CAddress address = ConsumeAddress(fuzzed_data_provider);
|
||||
|
|
Loading…
Reference in a new issue