[tor-commits] [tor/release-0.2.4] Make sure expiry check in dirserv_expire_measured_bw_cache() works if time_t is unsigned

arma at torproject.org arma at torproject.org
Thu Apr 11 05:29:50 UTC 2013


commit 302d1dae6c468fd2bd5551de654e36b8464a7eab
Author: Andrea Shepard <andrea at torproject.org>
Date:   Thu Mar 7 05:10:54 2013 -0800

    Make sure expiry check in dirserv_expire_measured_bw_cache() works if time_t is unsigned
---
 src/or/dirserv.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 1846dc1..3dfa1e7 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -2125,7 +2125,7 @@ dirserv_expire_measured_bw_cache(time_t now)
       e = (mbw_cache_entry_t *)e_v;
       if (e) {
         /* Check for expiration and remove if so */
-        if (now - e->as_of > MAX_MEASUREMENT_AGE) {
+        if (now > e->as_of + MAX_MEASUREMENT_AGE) {
           tor_free(e);
           rmv = 1;
         }





More information about the tor-commits mailing list