mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Avoid division by zero in circuitstats pareto
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 use INT32_MAX for the result. Division by zero traps under clang -fsanitize=undefined-trap -fsanitize-undefined-trap-on-error.
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
o Minor bugfixes:
|
||||
- In circuit_build_times_calculate_timeout() in circuitstats.c, avoid
|
||||
dividing by zero in the pareto calculations. This traps under
|
||||
clang -fsanitize=undefined-trap -fsanitize-undefined-trap-on-error.
|
||||
Fixes bug 13290.
|
||||
Reference in New Issue
Block a user