summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-08-01 11:23:00 -0400
committerNick Mathewson <nickm@torproject.org>2017-08-01 11:23:00 -0400
commit7c68b2f1a500cffbd51aaf534669e1c863de5ec5 (patch)
tree2efe4f9c1d2d6124e0522e6cd1cf30596e0e09d7
parent1d48712c286981d56c1b3c56b3fc38adc31a1343 (diff)
parent2b94b0ea721f2bd0127d097860ef64b915e2781a (diff)
downloadtor-7c68b2f1a500cffbd51aaf534669e1c863de5ec5.tar.gz
tor-7c68b2f1a500cffbd51aaf534669e1c863de5ec5.zip
Merge branch 'maint-0.2.9' into maint-0.3.0
-rw-r--r--changes/bug222455
-rw-r--r--src/or/hibernate.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/changes/bug22245 b/changes/bug22245
new file mode 100644
index 0000000000..6ae18593ea
--- /dev/null
+++ b/changes/bug22245
@@ -0,0 +1,5 @@
+ o Minor bugfixes (bandwidth accounting):
+ - Roll over monthly accounting at the configured hour and minute,
+ rather than always at 00:00.
+ Fixes bug 22245; bugfix on 0.0.9rc1.
+ Found by Andrey Karpov with PVS-Studio.
diff --git a/src/or/hibernate.c b/src/or/hibernate.c
index c2b3bbb839..8f28abb980 100644
--- a/src/or/hibernate.c
+++ b/src/or/hibernate.c
@@ -331,7 +331,7 @@ edge_of_accounting_period_containing(time_t now, int get_end)
case UNIT_MONTH: {
/* If this is before the Nth, we want the Nth of last month. */
if (tm.tm_mday < cfg_start_day ||
- (tm.tm_mday < cfg_start_day && before)) {
+ (tm.tm_mday == cfg_start_day && before)) {
--tm.tm_mon;
}
/* Otherwise, the month is correct. */