// Copyright (c) 2020 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include #include #include #include #include void test_one_input(const std::vector& buffer) { FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size()); const Network network = fuzzed_data_provider.PickValueInArray({NET_IPV4, NET_IPV6}); if (fuzzed_data_provider.remaining_bytes() < 16) { return; } CNetAddr net_addr; net_addr.SetRaw(network, fuzzed_data_provider.ConsumeBytes(16).data()); std::vector asmap; for (const char cur_byte : fuzzed_data_provider.ConsumeRemainingBytes()) { for (int bit = 0; bit < 8; ++bit) { asmap.push_back((cur_byte >> bit) & 1); } } (void)net_addr.GetMappedAS(asmap); }