diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-07-22 21:36:03 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-07-22 21:36:03 +0000 |
commit | 1391eafe67f49ff9a7e8d98dae34d90c5cb73b8e (patch) | |
tree | 3bdbf3e3087c17157d821aef554b26f1019612c6 /src | |
parent | 7b4865ec334ff705cea215a35aa13a75df90e715 (diff) | |
download | tor-1391eafe67f49ff9a7e8d98dae34d90c5cb73b8e.tar.gz tor-1391eafe67f49ff9a7e8d98dae34d90c5cb73b8e.zip |
Chek for overlong nicknames in add_nickname_list_to_smartlist
svn:r2109
Diffstat (limited to 'src')
-rw-r--r-- | src/or/routerlist.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c index dccb9f463c..f269b54967 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -158,6 +158,11 @@ void add_nickname_list_to_smartlist(smartlist_t *sl, const char *list) { start = list; while(*start) { end=start; while(*end && !isspace((int)*end) && *end != ',') end++; + if (end-start > MAX_HEX_NICKNAME_LEN) { + log_fn(LOG_WARN,"Nickname too long; skipping"); + start = end; + continue; + } memcpy(nick,start,end-start); nick[end-start] = 0; /* null terminate it */ router = router_get_by_nickname(nick); |