mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-01 00:34:01 +02:00
addrman: cap the max_pct to not exceed the maximum number of addresses
Co-authored-by: Vasil Dimov <vd@FreeBSD.org>
This commit is contained in:
@@ -173,7 +173,7 @@ FUZZ_TARGET(addrman, .init = initialize_addrman)
|
||||
network = fuzzed_data_provider.PickValueInArray(ALL_NETWORKS);
|
||||
}
|
||||
auto max_addresses = fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 4096);
|
||||
auto max_pct = fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 4096);
|
||||
auto max_pct = fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 100);
|
||||
auto filtered = fuzzed_data_provider.ConsumeBool();
|
||||
(void)const_addr_man.GetAddr(max_addresses, max_pct, network, filtered);
|
||||
|
||||
|
||||
@@ -110,13 +110,13 @@ FUZZ_TARGET(connman, .init = initialize_connman)
|
||||
},
|
||||
[&] {
|
||||
auto max_addresses = fuzzed_data_provider.ConsumeIntegral<size_t>();
|
||||
auto max_pct = fuzzed_data_provider.ConsumeIntegral<size_t>();
|
||||
auto max_pct = fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 100);
|
||||
auto filtered = fuzzed_data_provider.ConsumeBool();
|
||||
(void)connman.GetAddresses(max_addresses, max_pct, /*network=*/std::nullopt, filtered);
|
||||
},
|
||||
[&] {
|
||||
auto max_addresses = fuzzed_data_provider.ConsumeIntegral<size_t>();
|
||||
auto max_pct = fuzzed_data_provider.ConsumeIntegral<size_t>();
|
||||
auto max_pct = fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 100);
|
||||
(void)connman.GetAddresses(/*requestor=*/random_node, max_addresses, max_pct);
|
||||
},
|
||||
[&] {
|
||||
|
||||
Reference in New Issue
Block a user