diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index 564d077c2..703164307 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -280,6 +280,7 @@ namespace libtorrent bool peer_connection::unchoke_compare(boost::intrusive_ptr const& p) const { TORRENT_ASSERT(p); + TORRENT_ASSERT(this != p); peer_connection const& rhs = *p; // first compare how many bytes they've sent us diff --git a/src/session_impl.cpp b/src/session_impl.cpp index bc4a10b78..12dd5dc8c 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -1417,6 +1417,7 @@ namespace aux { , end(m_connections.end()); i != end; ++i) { peer_connection* p = i->get(); + TORRENT_ASSERT(p); torrent* t = p->associated_torrent().lock().get(); if (!p->peer_info_struct() || t == 0