From: Andrea Shepard Date: Thu, 7 Mar 2013 13:10:54 +0000 (-0800) Subject: Make sure expiry check in dirserv_expire_measured_bw_cache() works if time_t is unsigned X-Git-Tag: tor-0.2.4.12-alpha~5^2~44^2~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=302d1dae6c468fd2bd5551de654e36b8464a7eab;p=thirdparty%2Ftor.git Make sure expiry check in dirserv_expire_measured_bw_cache() works if time_t is unsigned --- diff --git a/src/or/dirserv.c b/src/or/dirserv.c index 1846dc1ba2..3dfa1e74de 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; }