[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] [tor/maint-0.2.2 3/4] Note an XXX about potential overflow



Author: Sebastian Hahn <sebastian@xxxxxxxxxxxxxx>
Date: Thu, 30 Sep 2010 06:11:51 +0200
Subject: Note an XXX about potential overflow
Commit: 0702429cf778f4eba4440a1b0356924e4574e923

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

diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index ee8c45d..e52165e 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -1928,6 +1928,8 @@ smartlist_choose_by_bandwidth(smartlist_t *sl, bandwidth_weight_rule_t rule,
       bitarray_set(guard_bits, i);
     if (is_known) {
       bandwidths[i] = (int32_t) this_bw; // safe since MAX_BELIEVABLE<INT32_MAX
+      // XXX this is no longer true! We don't always cap the bw anymore. Can
+      // a consensus make us overflow?-sh
       tor_assert(bandwidths[i] >= 0);
       if (is_guard)
         total_guard_bw += this_bw;
-- 
1.7.1