diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-01-31 08:43:52 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-01-31 08:43:54 +0100 |
commit | 1f514332eda21ef29be9931f48390e67f7323bd6 (patch) | |
tree | 8d15eddc9549d34d28d73c5b0278fb28dbea3e88 | |
parent | 16b784d953365bb2d7ae65acd2b20a79ef8ba7b6 (diff) | |
parent | dee2d6fbf9008d0e0667b3744d847192be6ef6e0 (diff) |
Merge #21037: fuzz: Avoid designated initialization (C++20) in fuzz tests
dee2d6fbf9008d0e0667b3744d847192be6ef6e0 fuzz: Avoid designated initialization (C++20) in fuzz tests (practicalswift)
Pull request description:
Avoid designated initialization (C++20) in fuzz tests.
Context: https://github.com/bitcoin/bitcoin/pull/20197#discussion_r565270556, https://github.com/bitcoin/bitcoin/pull/20936#discussion_r566708730
ACKs for top commit:
MarcoFalke:
cr ACK dee2d6fbf9008d0e0667b3744d847192be6ef6e0
dhruv:
code review ACK dee2d6fbf9008d0e0667b3744d847192be6ef6e0
ajtowns:
utACK dee2d6fbf9008d0e0667b3744d847192be6ef6e0
Tree-SHA512: 5940fab6e97a2b11dd3b1475d2cffa2840dc2e6ec34bd9f9df90f948709cab98fd1c513d5dd104816d33a525a6e9710b8715b02db941e35d84f92bc211f56d1d
-rw-r--r-- | src/test/fuzz/util.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/fuzz/util.h b/src/test/fuzz/util.h index a12dc9a56d..e48771efa2 100644 --- a/src/test/fuzz/util.h +++ b/src/test/fuzz/util.h @@ -269,8 +269,8 @@ inline CNetAddr ConsumeNetAddr(FuzzedDataProvider& fuzzed_data_provider) noexcep const Network network = fuzzed_data_provider.PickValueInArray({Network::NET_IPV4, Network::NET_IPV6, Network::NET_INTERNAL, Network::NET_ONION}); CNetAddr net_addr; if (network == Network::NET_IPV4) { - const in_addr v4_addr = { - .s_addr = fuzzed_data_provider.ConsumeIntegral<uint32_t>()}; + in_addr v4_addr = {}; + v4_addr.s_addr = fuzzed_data_provider.ConsumeIntegral<uint32_t>(); net_addr = CNetAddr{v4_addr}; } else if (network == Network::NET_IPV6) { if (fuzzed_data_provider.remaining_bytes() >= 16) { |