diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-08-18 04:44:24 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-08-18 04:44:24 +0000 |
commit | 86980cf6e232dd30de59bec2c32e0a85c81eb1d2 (patch) | |
tree | 68b23af0d396f5b063638b3e9c4f50a33a4473b0 /src/or/routerparse.c | |
parent | adccf3aea6ef7d33bd5cfcd322d5168b2c12415b (diff) | |
download | tor-86980cf6e232dd30de59bec2c32e0a85c81eb1d2.tar tor-86980cf6e232dd30de59bec2c32e0a85c81eb1d2.tar.gz |
Functions to test nickname validity
svn:r2269
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r-- | src/or/routerparse.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c index f3e6a53f8..f434dcd66 100644 --- a/src/or/routerparse.c +++ b/src/or/routerparse.c @@ -681,13 +681,8 @@ routerinfo_t *router_parse_entry_from_string(const char *s, if (tok->n_args == 2 || tok->n_args == 5 || tok->n_args == 6) { router->nickname = tor_strdup(tok->args[0]); - if (strlen(router->nickname) > MAX_NICKNAME_LEN) { - log_fn(LOG_WARN,"Router nickname too long."); - goto err; - } - if (strspn(router->nickname, LEGAL_NICKNAME_CHARACTERS) != - strlen(router->nickname)) { - log_fn(LOG_WARN, "Router nickname contains illegal characters."); + if (!is_legal_nickname(router->nickname)) { + log_fn(LOG_WARN,"Router nickname is invalid"); goto err; } router->address = tor_strdup(tok->args[1]); |