This is a well known (long standing) issue. Documented in the code base in commit eea02be70ee37b845f2719b3c08e5baf4b6f51f6.

Countless intermittent sanitizer warnings can be attributed to it.
int ret = in_data ? readData(pch, nBytes) : readHeader(pch, nBytes);
        if (ret < 0) Reset();
        return ret;
    }
    CNetMessage GetMessage(const CMessageHeader::MessageStartChars& message_start, int64_t time) override;
};
/** The TransportSerializer prepares messages for the network transport
 */
class TransportSerializer {
public:
    
    virtual void prepareForTransport(CSerializedNetMsg& msg, std::vector<unsigned char>& header) = 0;
    virtual ~TransportSerializer() {}
};
class V1TransportSerializer  : public TransportSerializer {
public:
    void prepareForTransport(CSerializedNetMsg& msg, std::vector<unsigned char>& header) override;
};
class CNode
{
    friend class CConnman;
public:
    std::unique_ptr<TransportDeserializer> m_deserializer;
    std::unique_ptr<TransportSerializer> m_serializer;
    
    std::atomic<ServiceFlags> nServices{NODE_NONE};
    SOCKET hSocket GUARDED_BY(cs_hSocket);
    size_t nSendSize{0};