]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix for running-routers length bug
authorNick Mathewson <nickm@torproject.org>
Fri, 24 Dec 2004 01:41:52 +0000 (01:41 +0000)
committerNick Mathewson <nickm@torproject.org>
Fri, 24 Dec 2004 01:41:52 +0000 (01:41 +0000)
svn:r3216

src/or/dirserv.c

index 2af2ddbdc13eb368aa9311ec7e477ca35226bb9f..9c35816a1a53f547411a4dbf9452180d6d368d04 100644 (file)
@@ -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"