aboutsummaryrefslogtreecommitdiff
path: root/src/or/dirserv.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r--src/or/dirserv.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 8dc4de008..10197e27c 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -376,6 +376,7 @@ dirserv_dump_directory_to_string(char *s, int maxlen,
for (i = 0; i < n_descriptors; ++i) {
strncat(cp, descriptor_list[i]->descriptor, descriptor_list[i]->desc_len);
+ /* XXX Nick: do strncat and friends null-terminate? man page is ambiguous. */
cp += descriptor_list[i]->desc_len;
assert(!*cp);
}
@@ -400,6 +401,7 @@ dirserv_dump_directory_to_string(char *s, int maxlen,
((int)digest[2])&0xff,((int)digest[3])&0xff);
strncpy(cp, "-----BEGIN SIGNATURE-----\n", maxlen-i);
+ cp[maxlen-i-1] = 0;
i = strlen(s);
cp = s+i;