diff options
author | Roger Dingledine <arma@torproject.org> | 2005-12-18 22:45:27 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2005-12-18 22:45:27 +0000 |
commit | 34249e8861eb549d37600eccde632ac6142d57db (patch) | |
tree | 9678ac37cb67f0098b2abbcce3a3adca259db1ab /src/or | |
parent | 99e1845339df46997ace773ed0e8ab5b4a8d35a1 (diff) | |
download | tor-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.c | 7 |
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); |