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)

* @param[in] network        Select only addresses of this network (nullopt = all).
     */
    void GetAddr_(std::vector<CAddress>& vAddr, size_t max_addresses, size_t max_pct, std::optional<Network> network) EXCLUSIVE_LOCKS_REQUIRED(cs);
    /** We have successfully connected to this peer. Calling this function
     *  updates the CAddress's nTime, which is used in our IsTerrible()
     *  decisions and gossiped to peers. Callers should be careful that updating
     *  this information doesn't leak topology information to network spies.
     *
     *  net_processing calls this function when it *disconnects* from a peer to
     *  not leak information about currently connected peers.
     *
     * @param[in]   addr     The address of the peer we were connected to
     * @param[in]   nTime    The time that we were last connected to this peer
     */
    void Connected_(const CService& addr, int64_t nTime) EXCLUSIVE_LOCKS_REQUIRED(cs);
    
    void SetServices_(const CService &addr, ServiceFlags nServices) EXCLUSIVE_LOCKS_REQUIRED(cs);
    
    void RemoveInvalid() EXCLUSIVE_LOCKS_REQUIRED(cs);
    /**
     * Reset the ports of I2P peers to 0.
     * This is needed as a temporary measure because now we enforce port 0 and
     * only connect to I2P hosts if the port is 0, but in the early days some
     * I2P addresses with port 8333 were rumoured and persisted into addrmans.
     */
    void ResetI2PPorts() EXCLUSIVE_LOCKS_REQUIRED(cs);
    friend class CAddrManTest;
};
#endif