[or-cvs] r16575: {tor} Two consensus fixes: always reset has_* to 0, and use a buff (tor/trunk/src/or)

weasel at seul.org weasel at seul.org
Sun Aug 17 08:01:23 UTC 2008


Author: weasel
Date: 2008-08-17 04:01:23 -0400 (Sun, 17 Aug 2008)
New Revision: 16575

Modified:
   tor/trunk/src/or/dirvote.c
Log:
Two consensus fixes:  always reset has_* to 0, and use a buffer of proper length for exitsummaries.

Modified: tor/trunk/src/or/dirvote.c
===================================================================
--- tor/trunk/src/or/dirvote.c	2008-08-17 04:33:38 UTC (rev 16574)
+++ tor/trunk/src/or/dirvote.c	2008-08-17 08:01:23 UTC (rev 16575)
@@ -878,6 +878,8 @@
       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 @@
       };
       /*     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.");



More information about the tor-commits mailing list