From 3c0b0ccca9d035c1ffbae94949edf76333310bd4 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sun, 17 Aug 2008 08:01:23 +0000 Subject: [PATCH] Two consensus fixes: always reset has_* to 0, and use a buffer of proper length for exitsummaries. svn:r16575 --- src/or/dirvote.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/or/dirvote.c b/src/or/dirvote.c index 52336988fb..661ebc1813 100644 --- a/src/or/dirvote.c +++ b/src/or/dirvote.c @@ -878,6 +878,8 @@ networkstatus_compute_consensus(smartlist_t *votes, rs_out.published_on = rs->status.published_on; rs_out.dir_port = rs->status.dir_port; rs_out.or_port = rs->status.or_port; + rs_out.has_bandwidth = 0; + rs_out.has_exitsummary = 0; if (chosen_name && !naming_conflict) { strlcpy(rs_out.nickname, chosen_name, sizeof(rs_out.nickname)); @@ -1046,6 +1048,7 @@ networkstatus_compute_consensus(smartlist_t *votes, }; /* Now the exitpolicy summary line. */ if (rs_out.has_exitsummary) { + char buf[MAX_POLICY_LINE_LEN+1]; int r = tor_snprintf(buf, sizeof(buf), "p %s\n", rs_out.exitsummary); if (r<0) { log_warn(LD_BUG, "Not enough space in buffer for exitpolicy line.");