diff options
author | teor <teor2345@gmail.com> | 2014-09-29 20:24:40 +1000 |
---|---|---|
committer | teor <teor2345@gmail.com> | 2014-09-29 20:49:24 +1000 |
commit | 4d0ad34a92dff2be0b23e75ca5373054a5c9334a (patch) | |
tree | b3e3c327faad7cf8e90a8b985878b49229a8f78e /changes | |
parent | ffd92e8ef885f4a63fd09892d508674c9b4a1daf (diff) | |
download | tor-4d0ad34a92dff2be0b23e75ca5373054a5c9334a.tar.gz tor-4d0ad34a92dff2be0b23e75ca5373054a5c9334a.zip |
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.
Diffstat (limited to 'changes')
-rw-r--r-- | changes/bug13290-avoid-div-zero-circuitstatus-pareto | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/changes/bug13290-avoid-div-zero-circuitstatus-pareto b/changes/bug13290-avoid-div-zero-circuitstatus-pareto new file mode 100644 index 0000000000..42b121f9dd --- /dev/null +++ b/changes/bug13290-avoid-div-zero-circuitstatus-pareto @@ -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. |