[or-cvs] [tor/master 08/15] Fix a bug in smartlist_choose_node_by_bandwidth

nickm at torproject.org nickm at torproject.org
Wed Oct 13 19:59:50 UTC 2010


Author: Nick Mathewson <nickm at torproject.org>
Date: Fri, 1 Oct 2010 17:22:04 -0400
Subject: Fix a bug in smartlist_choose_node_by_bandwidth
Commit: 42acef68ad6fbe462a00815fbccf94c817931e8f

---
 src/or/routerlist.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 73657fc..05ecbe3 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -1878,7 +1878,7 @@ static const node_t *
 smartlist_choose_node_by_bandwidth(smartlist_t *sl,
                                    bandwidth_weight_rule_t rule)
 {
-  unsigned int i;
+  unsigned i;
   const routerstatus_t *status=NULL;
   int32_t *bandwidths;
   int is_exit;
@@ -1925,6 +1925,7 @@ smartlist_choose_node_by_bandwidth(smartlist_t *sl,
     int is_known = 1;
     int32_t flags = 0;
     uint32_t this_bw = 0;
+    i = node_sl_idx;
 
     if (router_digest_is_me(node->identity))
       me_idx = node_sl_idx;
-- 
1.7.1




More information about the tor-commits mailing list