[or-cvs] r10549: Fix bug in 10533: put "opt v" line at the end of a routersta (in tor/trunk: . src/or)

nickm at seul.org nickm at seul.org
Sun Jun 10 19:13:40 UTC 2007


Author: nickm
Date: 2007-06-10 15:13:40 -0400 (Sun, 10 Jun 2007)
New Revision: 10549

Modified:
   tor/trunk/
   tor/trunk/src/or/dirserv.c
   tor/trunk/src/or/test.c
Log:
 r13338 at catbus:  nickm | 2007-06-10 15:13:32 -0400
 Fix bug in 10533: put "opt v" line at the end of a routerstatus section; overwriting is bad.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r13338] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/src/or/dirserv.c
===================================================================
--- tor/trunk/src/or/dirserv.c	2007-06-10 07:34:21 UTC (rev 10548)
+++ tor/trunk/src/or/dirserv.c	2007-06-10 19:13:40 UTC (rev 10549)
@@ -1655,9 +1655,10 @@
     log_warn(LD_BUG, "Not enough space in buffer.");
     return -1;
   }
+  cp += strlen(cp);
 
   if (version) {
-    if (tor_snprintf(buf, buf_len, "opt v %s\n", version)<0) {
+    if (tor_snprintf(cp, buf_len - (cp-buf), "opt v %s\n", version)<0) {
       log_warn(LD_BUG, "Unable to print router version.");
       return -1;
     }

Modified: tor/trunk/src/or/test.c
===================================================================
--- tor/trunk/src/or/test.c	2007-06-10 07:34:21 UTC (rev 10548)
+++ tor/trunk/src/or/test.c	2007-06-10 19:13:40 UTC (rev 10549)
@@ -2126,6 +2126,11 @@
 }
 
 static void
+test_v3_networkstatus(void)
+{
+}
+
+static void
 test_policies(void)
 {
   addr_policy_t *policy, *policy2;
@@ -2412,6 +2417,7 @@
   test_onion_handshake();
   puts("\n========================= Directory Formats ===============");
   test_dir_format();
+  test_v3_networkstatus();
   puts("\n========================= Policies ===================");
   test_policies();
   puts("\n========================= Rendezvous functionality ========");



More information about the tor-commits mailing list