diff options
author | certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b <certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2004-06-06 18:16:08 +0000 |
---|---|---|
committer | certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b <certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2004-06-06 18:16:08 +0000 |
commit | 1c908480b6599e4fec49eeb57d1a6e1fe2d40de0 (patch) | |
tree | 1de0ae8f46224306f360bfe963c44dbb5ee8d553 /nickserv.c | |
parent | 019521bc0938a1b1517b01500923589a4a11e698 (diff) |
BUILD : 1.7.3 (171) BUGS : NOTES : Fixed big with long NSGuestNickPrefixes. We just used them in a snprintf without checking their size. Fixed a second guestnick bug as well: if compiled for hybrid guestnum was increased, tho it was never used.
git-svn-id: svn://svn.anope.org/anope/trunk@171 31f1291d-b8d6-0310-a050-a5561fc1590b
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@119 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'nickserv.c')
-rw-r--r-- | nickserv.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/nickserv.c b/nickserv.c index 4a5986170..26a906880 100644 --- a/nickserv.c +++ b/nickserv.c @@ -23,7 +23,7 @@ NickAlias *nalists[1024]; NickCore *nclists[1024]; NickRequest *nrlists[1024]; -int guestnum; /* Current guest number */ +unsigned int guestnum; /* Current guest number */ #define TO_COLLIDE 0 /* Collide the user with this nick */ #define TO_RELEASE 1 /* Release a collided nick */ @@ -1660,12 +1660,15 @@ static void collide(NickAlias * na, int from_timeout) * per second. So let use another safer method. * --lara */ + /* So you should check the length of NSGuestNickPrefix, eh Lara? + * --Certus + */ - snprintf(guestnick, sizeof(guestnick), "%s%d", NSGuestNickPrefix, - guestnum++); #ifdef IRC_HYBRID kill_user(s_NickServ, na->nick, "Services nickname-enforcer kill"); #else + snprintf(guestnick, sizeof(guestnick), "%s%d", NSGuestNickPrefix, + guestnum++); notice_lang(s_NickServ, na->u, FORCENICKCHANGE_CHANGING, guestnick); send_cmd(NULL, "SVSNICK %s %s :%ld", na->nick, guestnick, time(NULL)); na->status |= NS_GUESTED; |