From b354e7e0d9c826512a89f61c30765a22ea2cd43e Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Tue, 1 Jul 2008 20:22:25 +0000 Subject: [PATCH] fixed bug in extension loop --- src/bt_peer_connection.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bt_peer_connection.cpp b/src/bt_peer_connection.cpp index 4a48b7ae3..16e63728a 100644 --- a/src/bt_peer_connection.cpp +++ b/src/bt_peer_connection.cpp @@ -1261,8 +1261,8 @@ namespace libtorrent #endif #ifndef TORRENT_DISABLE_EXTENSIONS - for (extension_list_t::iterator i = m_extensions.begin() - , end(m_extensions.end()); i != end;) + for (extension_list_t::iterator i = m_extensions.begin(); + !m_extensions.empty() && i != m_extensions.end();) { // a false return value means that the extension // isn't supported by the other end. So, it is removed.