diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-07-22 21:31:04 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-07-22 21:31:04 +0000 |
commit | 7b4865ec334ff705cea215a35aa13a75df90e715 (patch) | |
tree | 7f150c02da248f6cb5e1557f0d0f3d090e0a55a7 /src | |
parent | 0c990259dec0ba48efda20cb4b0e58cd2965ec3f (diff) | |
download | tor-7b4865ec334ff705cea215a35aa13a75df90e715.tar.gz tor-7b4865ec334ff705cea215a35aa13a75df90e715.zip |
Add notion of "longest nickname-or-hex-digest-with-$"
svn:r2108
Diffstat (limited to 'src')
-rw-r--r-- | src/or/dirserv.c | 2 | ||||
-rw-r--r-- | src/or/or.h | 2 | ||||
-rw-r--r-- | src/or/routerlist.c | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c index 9dfd4601de..ae8968ce2a 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -699,7 +699,7 @@ static int generate_runningrouters(crypto_pk_env_t *private_key) char published[33]; time_t published_on; - len = 1024+MAX_NICKNAME_LEN*smartlist_len(descriptor_list); + len = 1024+(MAX_HEX_NICKNAME_LEN+2)*smartlist_len(descriptor_list); s = tor_malloc_zero(len); if (list_running_servers(&cp)) return -1; diff --git a/src/or/or.h b/src/or/or.h index ae5ae26a8a..ec1e9eafda 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -123,6 +123,8 @@ #define DEFAULT_BANDWIDTH_OP (1024 * 1000) #define MAX_NICKNAME_LEN 19 +/* Hex digest plus dollar sign. */ +#define MAX_HEX_NICKNAME_LEN HEX_DIGEST_LEN+1 #define MAX_DIR_SIZE 500000 #ifdef TOR_PERF diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 5b3d81890f..dccb9f463c 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -147,7 +147,7 @@ int all_directory_servers_down(void) { */ void add_nickname_list_to_smartlist(smartlist_t *sl, const char *list) { const char *start,*end; - char nick[MAX_NICKNAME_LEN+1]; + char nick[MAX_HEX_NICKNAME_LEN+1]; routerinfo_t *router; tor_assert(sl); |