r15319@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.


svn:r11607
This commit is contained in:
Nick Mathewson 2007-09-24 15:53:49 +00:00
parent 383c8deced
commit 3115905506
3 changed files with 10 additions and 4 deletions

View File

@ -7,6 +7,9 @@ Changes in version 0.1.2.18 - 2007-??-??
- 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

View File

@ -24,5 +24,5 @@ Backport for 0.1.2.x once better tested:
- 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("~")

View File

@ -1723,9 +1723,11 @@ extend_info_from_router(routerinfo_t *r)
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_from_routerstatus(routerstatus_t *s)
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;