aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2005-12-18 22:45:27 +0000
committerRoger Dingledine <arma@torproject.org>2005-12-18 22:45:27 +0000
commit34249e8861eb549d37600eccde632ac6142d57db (patch)
tree9678ac37cb67f0098b2abbcce3a3adca259db1ab /src/or
parent99e1845339df46997ace773ed0e8ab5b4a8d35a1 (diff)
downloadtor-34249e8861eb549d37600eccde632ac6142d57db.tar
tor-34249e8861eb549d37600eccde632ac6142d57db.tar.gz
fix segfault when specifying DirServer without nickname
(reported by weasel) svn:r5614
Diffstat (limited to 'src/or')
-rw-r--r--src/or/routerlist.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 5c9d9b230..4cb05ac72 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -2558,8 +2558,11 @@ add_trusted_dir_server(const char *nickname, const char *address,
ent->fake_status.addr = ent->addr;
memcpy(ent->fake_status.identity_digest, digest, DIGEST_LEN);
- strlcpy(ent->fake_status.nickname, nickname,
- sizeof(ent->fake_status.nickname));
+ if (nickname)
+ strlcpy(ent->fake_status.nickname, nickname,
+ sizeof(ent->fake_status.nickname));
+ else
+ ent->fake_status.nickname[0] = '\0';
ent->fake_status.dir_port = ent->dir_port;
smartlist_add(trusted_dir_servers, ent);