[tor-bugs] #13290 [Tor]: Avoid division by zero in circuitstats pareto calculations

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Sep 29 10:45:40 UTC 2014


#13290: Avoid division by zero in circuitstats pareto calculations
------------------------+----------------------------------
 Reporter:  teor        |          Owner:
     Type:  defect      |         Status:  new
 Priority:  normal      |      Milestone:
Component:  Tor         |        Version:  Tor: unspecified
 Keywords:  tor-router  |  Actual Points:
Parent ID:              |         Points:
------------------------+----------------------------------
 In circuit_build_times_calculate_timeout() in circuitstats.c, avoid
 dividing by zero in the pareto calculations.

 If either the alpha or p parameters are 0, we would divide by zero,
 yielding an infinite result; which would be clamped to INT32_MAX anyway.
 So rather than dividing by zero, we just skip the offending
 calculation(s), and just use INT32_MAX for the result.

 Division by zero a crash under clang -fsanitize=undefined-trap -fsanitize-
 undefined-trap-on-error

 I'll submit a github branch once I have the bug number for the changes
 file name.

 tor version: 2.6.0-alpha-dev

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


More information about the tor-bugs mailing list