[or-cvs] r11607: Backport r11293: bulletproof the code that generates extend_ (in tor/branches/tor-0_1_2-patches: . doc src/or)

nickm at seul.org nickm at seul.org
Mon Sep 24 15:53:49 UTC 2007


Author: nickm
Date: 2007-09-24 11:53:49 -0400 (Mon, 24 Sep 2007)
New Revision: 11607

Modified:
   tor/branches/tor-0_1_2-patches/
   tor/branches/tor-0_1_2-patches/ChangeLog
   tor/branches/tor-0_1_2-patches/doc/TODO.012
   tor/branches/tor-0_1_2-patches/src/or/circuitbuild.c
Log:
 r15319 at catbus:  nickm | 2007-09-24 11:47:16 -0400
 Backport r11293: bulletproof the code that generates extend_info.  I am still not sure whether this bug ever occurs on 0.1.2.x, or whether it only appears when the bridge code is present, but in any case it costs us nothing.



Property changes on: tor/branches/tor-0_1_2-patches
___________________________________________________________________
 svk:merge ticket from /tor/012 [r15319] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/branches/tor-0_1_2-patches/ChangeLog
===================================================================
--- tor/branches/tor-0_1_2-patches/ChangeLog	2007-09-24 15:53:47 UTC (rev 11606)
+++ tor/branches/tor-0_1_2-patches/ChangeLog	2007-09-24 15:53:49 UTC (rev 11607)
@@ -7,6 +7,9 @@
     - Don't try to access (or alter) the state file when running
       --list-fingerprint or --verify-config or --hash-password. (Resolves
       bug 499.)
+    - When generating information telling us how to extend to a given
+      router, do not try to include the nickname if it is absent. (Resolves
+      bug 467.)
 
   o Minor bugfixes (controller):
     - When sending a status event to the controller telling it that an

Modified: tor/branches/tor-0_1_2-patches/doc/TODO.012
===================================================================
--- tor/branches/tor-0_1_2-patches/doc/TODO.012	2007-09-24 15:53:47 UTC (rev 11606)
+++ tor/branches/tor-0_1_2-patches/doc/TODO.012	2007-09-24 15:53:49 UTC (rev 11607)
@@ -24,5 +24,5 @@
   - r11287: Reject address mappings to internal addresses. (??)
   - r11499, r11500, r11501: hidserv hexdigests rather than nicknames
   - r11548, the osx /tmp fix
-  - r11293: Bulletproof code to generate extend info.
+  o r11293: Bulletproof code to generate extend info.
   - r11332: Fix user-triggerable segfault in expand_filename("~")
\ No newline at end of file

Modified: tor/branches/tor-0_1_2-patches/src/or/circuitbuild.c
===================================================================
--- tor/branches/tor-0_1_2-patches/src/or/circuitbuild.c	2007-09-24 15:53:47 UTC (rev 11606)
+++ tor/branches/tor-0_1_2-patches/src/or/circuitbuild.c	2007-09-24 15:53:49 UTC (rev 11607)
@@ -1723,9 +1723,11 @@
   extend_info_t *info;
   tor_assert(r);
   info = tor_malloc_zero(sizeof(extend_info_t));
-  strlcpy(info->nickname, r->nickname, sizeof(info->nickname));
+  if (r->nickname)
+    strlcpy(info->nickname, r->nickname, sizeof(info->nickname));
   memcpy(info->identity_digest, r->cache_info.identity_digest, DIGEST_LEN);
-  info->onion_key = crypto_pk_dup_key(r->onion_pkey);
+  if (r->onion_pkey)
+    info->onion_key = crypto_pk_dup_key(r->onion_pkey);
   info->addr = r->addr;
   info->port = r->or_port;
   return info;
@@ -1739,7 +1741,8 @@
   extend_info_t *info;
   tor_assert(s);
   info = tor_malloc_zero(sizeof(extend_info_t));
-  strlcpy(info->nickname, s->nickname, sizeof(info->nickname));
+  if (s->nickname)
+    strlcpy(info->nickname, s->nickname, sizeof(info->nickname));
   memcpy(info->identity_digest, s->identity_digest, DIGEST_LEN);
   info->onion_key = NULL; /* routerstatus doesn't know this */
   info->addr = s->addr;



More information about the tor-commits mailing list