diff --git a/src/smart_ban.cpp b/src/smart_ban.cpp index 59143f4c3..50f96f606 100644 --- a/src/smart_ban.cpp +++ b/src/smart_ban.cpp @@ -177,7 +177,7 @@ namespace libtorrent { namespace aux::session_impl::mutex_t::scoped_lock l(m_torrent.session().m_mutex); std::map::iterator i = m_block_crc.lower_bound(b); - if (i->first == b && i->second.peer == p) + if (i != m_block_crc.end() && i->first == b && i->second.peer == p) { // this peer has sent us this block before if (i->second.crc != e.crc)