From 1724b1eb7593f9a7e26169160fabfd1dec64c9c3 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Wed, 16 Apr 2008 03:20:35 +0000 Subject: [PATCH] dht array index out of bound fix --- src/kademlia/routing_table.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kademlia/routing_table.cpp b/src/kademlia/routing_table.cpp index 1a55126f3..1deb00a71 100644 --- a/src/kademlia/routing_table.cpp +++ b/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; }