summaryrefslogtreecommitdiff
path: root/src/or/routerparse.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-01-03 17:53:20 +0000
committerNick Mathewson <nickm@torproject.org>2005-01-03 17:53:20 +0000
commitfca7ba977765061731873ef36a32777f0df8ee89 (patch)
tree1daf736f4f1514112bb85c8aa5be6dfa7745d5a8 /src/or/routerparse.c
parent59504f483157420dc2562e8a750070965a2cdc42 (diff)
downloadtor-fca7ba977765061731873ef36a32777f0df8ee89.tar.gz
tor-fca7ba977765061731873ef36a32777f0df8ee89.zip
Resolve task 42: find where 19-char nicknames were getting truncated when read from certs, and fix it. Also audit use of MAX_NICKNAME_LEN; no other badness found, but some docs/code cleaned up a touch.
svn:r3244
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r--src/or/routerparse.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 78fb316ff9..9886d0ac17 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -340,6 +340,10 @@ router_parse_routerlist_from_directory(const char *str,
goto err;
/* now we know tok->n_args == 1, so it's safe to access tok->args[0] */
+ if (!is_legal_nickname(tok->args[0])) {
+ log_fn(LOG_WARN, "Directory nickname '%s' is misformed", tok->args[0]);
+ goto err;
+ }
strlcpy(dirnickname, tok->args[0], sizeof(dirnickname));
SMARTLIST_FOREACH(tokens, directory_token_t *, tok, token_free(tok));