mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-20 18:22:09 +01:00
Chek for overlong nicknames in add_nickname_list_to_smartlist
svn:r2109
This commit is contained in:
parent
7b4865ec33
commit
1391eafe67
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user