]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix the fencepost issue when we check stability_last_downrated
authorNeel Chauhan <neel@neelc.org>
Thu, 20 May 2021 18:06:50 +0000 (11:06 -0700)
committerNeel Chauhan <neel@neelc.org>
Thu, 20 May 2021 18:06:50 +0000 (11:06 -0700)
changes/bug40394 [new file with mode: 0644]
src/feature/stats/rephist.c

diff --git a/changes/bug40394 b/changes/bug40394
new file mode 100644 (file)
index 0000000..f55167f
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor bugfixes (statistics):
+    - Fix the fencepost issue when we check stability_last_downrated where
+      we call rep_hist_downrate_old_runs() twice. Fixes bug 40394; bugfix
+      on 0.2.0.5-alpha. Patch by Neel Chauhan.
index 50f6a11ae1c76fb04812d38fc0fb5b0dda44dfa4..59d5313cc8d4342400989b72b73f8525161df5c1 100644 (file)
@@ -731,7 +731,7 @@ rep_hist_downrate_old_runs(time_t now)
     return stability_last_downrated + STABILITY_INTERVAL;
 
   /* Okay, we should downrate the data.  By how much? */
-  while (stability_last_downrated + STABILITY_INTERVAL < now) {
+  while (stability_last_downrated + STABILITY_INTERVAL <= now) {
     stability_last_downrated += STABILITY_INTERVAL;
     alpha *= STABILITY_ALPHA;
   }