[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] Chek for overlong nicknames in add_nickname_list_to_smartlist
- To: or-cvs@freehaven.net
- Subject: [or-cvs] Chek for overlong nicknames in add_nickname_list_to_smartlist
- From: nickm@seul.org (Nick Mathewson)
- Date: Thu, 22 Jul 2004 17:36:05 -0400 (EDT)
- Delivered-to: archiver@seul.org
- Delivered-to: or-cvs-outgoing@seul.org
- Delivered-to: or-cvs@seul.org
- Delivery-date: Thu, 22 Jul 2004 17:36:10 -0400
- Reply-to: or-dev@freehaven.net
- Sender: owner-or-cvs@freehaven.net
Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/tmp/cvs-serv3005/src/or
Modified Files:
routerlist.c
Log Message:
Chek for overlong nicknames in add_nickname_list_to_smartlist
Index: routerlist.c
===================================================================
RCS file: /home/or/cvsroot/src/or/routerlist.c,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -d -r1.109 -r1.110
--- routerlist.c 22 Jul 2004 21:31:04 -0000 1.109
+++ routerlist.c 22 Jul 2004 21:36:03 -0000 1.110
@@ -158,6 +158,11 @@
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);