The problem was originally reported in https://github.com/bitcoin/bitcoin/issues/22450#issuecomment-880629375. This is a dedicated issue to track it independently because it is a different problem than the one reported in #22450 OP/description.

```
fuzz: addrman.cpp:149: void CAddrMan::SwapRandom(unsigned int, unsigned int): Assertion `nRndPos1 < vRandom.size() && nRndPos2 < vRandom.size()' failed.
```

To reproduce:
```sh
FUZZ=addrman_deserialize ./src/test/fuzz/fuzz /tmp/crash-ef7d4a4f940b8fdb4999f6a92969260cf8e1405f.log
```
[crash-ef7d4a4f940b8fdb4999f6a92969260cf8e1405f.log](https://github.com/bitcoin/bitcoin/files/6830072/crash-ef7d4a4f940b8fdb4999f6a92969260cf8e1405f.log)

BOOST_CHECK(addrman.size() == 23);
    CAddrInfo info = addrman.SelectTriedCollision();
    BOOST_CHECK(info.ToString() == "250.1.1.19:0");
    
    addrman.SimConnFail(info);
    
    addrman.ResolveCollisions();
    BOOST_CHECK(addrman.SelectTriedCollision().ToString() == "[::]:0");
    
    BOOST_CHECK(!addrman.Add(CAddress(addr, NODE_NONE), source));
    addrman.Good(addr);
    BOOST_CHECK(addrman.SelectTriedCollision().ToString() == "[::]:0");
    
    CService addr19 = ResolveService("250.1.1.19");
    BOOST_CHECK(!addrman.Add(CAddress(addr19, NODE_NONE), source));
    addrman.Good(addr19);
    BOOST_CHECK(addrman.SelectTriedCollision().ToString() == "250.1.1.23:0");
    addrman.ResolveCollisions();
    BOOST_CHECK(addrman.SelectTriedCollision().ToString() == "[::]:0");
}
BOOST_AUTO_TEST_CASE(reset_i2p_ports)
{
    CAddrManTest addrman1;
    CAddrManTest addrman2;
    const uint32_t good_time{static_cast<uint32_t>(GetAdjustedTime())};
    constexpr uint16_t port = 8333;
    
    const CAddress i2p_new1{
        ResolveService("72l3ucjkuscrbiiepoehuwqgknyzgo7zuix5ty4puwrkyhtmnsga.b32.i2p", port),
        NODE_NONE,