]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Make sure expiry check in dirserv_expire_measured_bw_cache() works if time_t is unsigned
authorAndrea Shepard <andrea@torproject.org>
Thu, 7 Mar 2013 13:10:54 +0000 (05:10 -0800)
committerAndrea Shepard <andrea@torproject.org>
Thu, 7 Mar 2013 13:10:54 +0000 (05:10 -0800)
src/or/dirserv.c

index 1846dc1ba2767e4201417f5799636a18af74430a..3dfa1e74ded51bda70cd77f261e3dbdffa6dc1d4 100644 (file)
@@ -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;
         }