diff options
author | Nick Mathewson <nickm@torproject.org> | 2005-01-03 17:53:20 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2005-01-03 17:53:20 +0000 |
commit | fca7ba977765061731873ef36a32777f0df8ee89 (patch) | |
tree | 1daf736f4f1514112bb85c8aa5be6dfa7745d5a8 /src/or/routerparse.c | |
parent | 59504f483157420dc2562e8a750070965a2cdc42 (diff) | |
download | tor-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.c | 4 |
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)); |