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)

{
    CAddrManTest addrman;
    BOOST_CHECK_EQUAL(addrman.size(), 0U);
    CAddress addr1 = CAddress(ResolveService("250.1.2.1", 8333), NODE_NONE);
    CNetAddr source1 = ResolveIP("250.1.2.1");
    int nId;
    CAddrInfo* pinfo = addrman.Create(addr1, source1, &nId);
    
    BOOST_CHECK_EQUAL(pinfo->ToString(), "250.1.2.1:8333");
    CAddrInfo* info2 = addrman.Find(addr1);
    BOOST_CHECK_EQUAL(info2->ToString(), "250.1.2.1:8333");
}
BOOST_AUTO_TEST_CASE(addrman_delete)
{
    CAddrManTest addrman;
    BOOST_CHECK_EQUAL(addrman.size(), 0U);
    CAddress addr1 = CAddress(ResolveService("250.1.2.1", 8333), NODE_NONE);
    CNetAddr source1 = ResolveIP("250.1.2.1");
    int nId;
    addrman.Create(addr1, source1, &nId);
    
    BOOST_CHECK_EQUAL(addrman.size(), 1U);
    addrman.Delete(nId);
    BOOST_CHECK_EQUAL(addrman.size(), 0U);
    CAddrInfo* info2 = addrman.Find(addr1);
    BOOST_CHECK(info2 == nullptr);
}
BOOST_AUTO_TEST_CASE(addrman_getaddr)