[tor-bugs] #26780 [Core Tor/Tor]: Fix division by zero error reports from Coverity (CID: 1415721, 1415722, and 1415723)

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Jul 19 15:22:28 UTC 2018


#26780: Fix division by zero error reports from Coverity (CID: 1415721, 1415722,
and 1415723)
--------------------------+----------------------------------
 Reporter:  ahf           |          Owner:  (none)
     Type:  defect        |         Status:  merge_ready
 Priority:  Medium        |      Milestone:  Tor: unspecified
Component:  Core Tor/Tor  |        Version:  Tor: unspecified
 Severity:  Normal        |     Resolution:
 Keywords:                |  Actual Points:
Parent ID:                |         Points:
 Reviewer:  asn           |        Sponsor:
--------------------------+----------------------------------
Changes (by asn):

 * status:  needs_review => merge_ready


Comment:

 Changes LGTM.

 I checked the coverity reports and I have no idea if the patch will fix
 them. I already imagine that coverity would not warn because of:
 {{{
   if (res < min_val) {
     log_warn(LD_DIR, "Consensus parameter %s is too small. Got %d, raising
 to "
              "%d.", param_name, res, min_val);
     res = min_val;
   } else if (res > max_val) {
     log_warn(LD_DIR, "Consensus parameter %s is too large. Got %d, capping
 to "
              "%d.", param_name, res, max_val);
     res = max_val;
   }
 }}}

 Perhaps let's get these asserts merged, and check coverity again? :)

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


More information about the tor-bugs mailing list