From cae769d646e721efff3c286a2c46769680dc01f5 Mon Sep 17 00:00:00 2001 From: Sebastian Hahn Date: Sun, 21 Mar 2010 06:03:13 +0100 Subject: Segfault less during consensus generation without params If no authority votes on any params, Tor authorities segfault when trying to make a new consensus from the votes. Let's change that. --- src/or/dirvote.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/or/dirvote.c') diff --git a/src/or/dirvote.c b/src/or/dirvote.c index ecf236e8fe..30e340c735 100644 --- a/src/or/dirvote.c +++ b/src/or/dirvote.c @@ -1757,10 +1757,12 @@ networkstatus_compute_consensus(smartlist_t *votes, // Parse params, extract BW_WEIGHT_SCALE if present // DO NOT use consensus_param_bw_weight_scale() in this code! // The consensus is not formed yet! - if (strcmpstart(params, "bwweightscale=") == 0) - bw_weight_param = params; - else - bw_weight_param = strstr(params, " bwweightscale="); + if (params) { + if (strcmpstart(params, "bwweightscale=") == 0) + bw_weight_param = params; + else + bw_weight_param = strstr(params, " bwweightscale="); + } if (bw_weight_param) { int ok=0; -- cgit v1.2.3-54-g00ecf