[tor-bugs] #23584 [- Select a component]: tor-0.3.1.7/src/or/torcert.c:396: bad expression ?

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Sep 19 16:10:15 UTC 2017


#23584: tor-0.3.1.7/src/or/torcert.c:396: bad expression ?
--------------------------------------+--------------------
     Reporter:  dcb314@…              |      Owner:  (none)
         Type:  defect                |     Status:  new
     Priority:  Medium                |  Milestone:
    Component:  - Select a component  |    Version:
     Severity:  Normal                |   Keywords:
Actual Points:                        |  Parent ID:
       Points:                        |   Reviewer:
      Sponsor:                        |
--------------------------------------+--------------------
 tor-0.3.1.7/src/or/torcert.c:396]: (style) int result is assigned to long
 variable.

 Source code is

   const uint32_t expiration_date = rsa_ed_crosscert_get_expiration(cc);
   const uint64_t expiration_time = expiration_date * 3600;

 Multiplying something by 3600 doesn't change its type. Suggest new code

   const uint32_t expiration_date = rsa_ed_crosscert_get_expiration(cc);
   const uint64_t expiration_time = expiration_date * 3600UL;

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


More information about the tor-bugs mailing list