summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-12-24 01:41:52 +0000
committerNick Mathewson <nickm@torproject.org>2004-12-24 01:41:52 +0000
commit7117366810c11845339ec21253d4d509b5aeb1e5 (patch)
tree609b86f31769d68598952749d8a4cb4ed284824d
parent650791b628cc00fecbc65accfd58ce85517a89a0 (diff)
downloadtor-7117366810c11845339ec21253d4d509b5aeb1e5.tar.gz
tor-7117366810c11845339ec21253d4d509b5aeb1e5.zip
Fix for running-routers length bug
svn:r3216
-rw-r--r--src/or/dirserv.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 2af2ddbdc1..9c35816a1a 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -834,8 +834,7 @@ static int generate_runningrouters(crypto_pk_env_t *private_key)
time_t published_on;
char *identity_pkey; /* Identity key, DER64-encoded. */
- len = 1024+(MAX_HEX_NICKNAME_LEN+2)*smartlist_len(descriptor_list);
- s = tor_malloc_zero(len);
+ /* For each descriptor we know, we might */
if (list_server_status(NULL, &router_status)) {
goto err;
}
@@ -859,6 +858,9 @@ static int generate_runningrouters(crypto_pk_env_t *private_key)
#endif
published_on = time(NULL);
format_iso_time(published, published_on);
+
+ len = 2048+strlen(router_status);
+ s = tor_malloc_zero(len);
tor_snprintf(s, len, "network-status\n"
"published %s\n"
"router-status %s\n"