diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-12-16 12:21:02 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-12-16 12:21:02 -0500 |
commit | 23c09b6bc2897ada21de220c48799f01171dcdf4 (patch) | |
tree | c12568ba32d5fd06d3dbd88d1dfbb7fd01727352 | |
parent | 2a00110e5bd3592ff69e659681b9294285a98dd0 (diff) | |
download | tor-23c09b6bc2897ada21de220c48799f01171dcdf4.tar.gz tor-23c09b6bc2897ada21de220c48799f01171dcdf4.zip |
Resolve a division-by-zero complaint from coverity. CID 1397272
-rw-r--r-- | src/or/entrynodes.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c index 8715af7957..2e46aba02c 100644 --- a/src/or/entrynodes.c +++ b/src/or/entrynodes.c @@ -638,7 +638,8 @@ choose_guard_selection(const or_options_t *options, */ static int have_warned_extreme_threshold = 0; - if (n_passing_filter < extreme_threshold && + if (n_guards && + n_passing_filter < extreme_threshold && ! have_warned_extreme_threshold) { have_warned_extreme_threshold = 1; const double exclude_frac = |