[or-cvs] Chek for overlong nicknames in add_nickname_list_to_smartlist
Nick Mathewson
nickm at seul.org
Thu Jul 22 21:36:05 UTC 2004
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);
More information about the tor-commits
mailing list