[tor-bugs] #22245 [Core Tor/Tor]: Logic error with monthly accounting

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat May 13 07:30:06 UTC 2017


#22245: Logic error with monthly accounting
------------------------------+--------------------------------
     Reporter:  arma          |      Owner:
         Type:  defect        |     Status:  new
     Priority:  Medium        |  Milestone:  Tor: 0.3.1.x-final
    Component:  Core Tor/Tor  |    Version:
     Severity:  Normal        |   Keywords:
Actual Points:                |  Parent ID:
       Points:                |   Reviewer:
      Sponsor:                |
------------------------------+--------------------------------
 Here's the code in src/or/hibernate.c:
 {{{
       /* 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_mon;
       }
 }}}
 Andrey Karpov points out in https://www.viva64.com/en/b/0507/ that the
 second clause of the if is redundant with the first clause.

 Looking at it more, I think we wanted that second clause to be
 {{{(tm.tm_mday == cfg_start_day && before)}}}.

 What are the implications of this bug for relays that do monthly
 accounting?

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/22245>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list