mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
fix segfault when specifying DirServer without nickname
(reported by weasel) svn:r5614
This commit is contained in:
+5
-2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user