Skip to content

Commit e5b9ee0

Browse files
committed
fuzz: set nMaxOutboundLimit in connman target
1 parent 65c05db commit e5b9ee0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/test/fuzz/connman.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ FUZZ_TARGET(connman, .init = initialize_connman)
3838
*g_setup->m_node.netgroupman,
3939
Params(),
4040
fuzzed_data_provider.ConsumeBool()};
41+
42+
const uint64_t max_outbound_limit{fuzzed_data_provider.ConsumeIntegral<uint64_t>()};
43+
connman.Init({ .nMaxOutboundLimit = max_outbound_limit });
44+
4145
CNetAddr random_netaddr;
4246
CNode random_node = ConsumeNode(fuzzed_data_provider);
4347
CSubNet random_subnet;
@@ -125,7 +129,7 @@ FUZZ_TARGET(connman, .init = initialize_connman)
125129
(void)connman.GetAddedNodeInfo(fuzzed_data_provider.ConsumeBool());
126130
(void)connman.GetExtraFullOutboundCount();
127131
(void)connman.GetLocalServices();
128-
(void)connman.GetMaxOutboundTarget();
132+
assert(connman.GetMaxOutboundTarget() == max_outbound_limit);
129133
(void)connman.GetMaxOutboundTimeframe();
130134
(void)connman.GetMaxOutboundTimeLeftInCycle();
131135
(void)connman.GetNetworkActive();

0 commit comments

Comments
 (0)