Resolve a division-by-zero complaint from coverity. CID 1397272

This commit is contained in:
Nick Mathewson 2016-12-16 12:21:02 -05:00
parent 2a00110e5b
commit 23c09b6bc2

View File

@ -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 =