From 6a693d10ab556782afd35ab841826af30f8dfe20 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Sat, 19 Apr 2008 17:08:28 +0000 Subject: [PATCH] dht array index out of bound fix --- libtorrent/src/kademlia/routing_table.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libtorrent/src/kademlia/routing_table.cpp b/libtorrent/src/kademlia/routing_table.cpp index 359577613..6faeb6f50 100644 --- a/libtorrent/src/kademlia/routing_table.cpp +++ b/libtorrent/src/kademlia/routing_table.cpp @@ -229,8 +229,8 @@ void routing_table::node_failed(node_id const& id) { b.erase(i); TORRENT_ASSERT(m_lowest_active_bucket <= bucket_index); - while (m_buckets[m_lowest_active_bucket].first.empty() - && m_lowest_active_bucket < 160) + while (m_lowest_active_bucket < 160 + && m_buckets[m_lowest_active_bucket].first.empty()) { ++m_lowest_active_bucket; }