From 31992bbc850f6f81549479fec286edb609a55570 Mon Sep 17 00:00:00 2001 From: Michael Poole Date: Wed, 10 Nov 2004 01:25:53 +0000 Subject: [PATCH] Fix nick length check in is_valid_nick(). The for() loop in is_valid_nick() leaves 'nick' as an empty string, which is obviosly shorter than the nick length limit. Fix that. git-archimport-id: srvx@srvx.net--2004-srvx/srvx--devo--1.3--patch-83 --- ChangeLog | 14 ++++++++++++++ src/proto-p10.c | 5 +++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b577fd0..43fe2e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,20 @@ # arch-tag: automatic-ChangeLog--srvx@srvx.net--2004-srvx/srvx--devo--1.3 # +2004-11-10 01:25:53 GMT Michael Poole patch-83 + + Summary: + Fix nick length check in is_valid_nick(). + Revision: + srvx--devo--1.3--patch-83 + + The for() loop in is_valid_nick() leaves 'nick' as an empty string, + which is obviosly shorter than the nick length limit. Fix that. + + modified files: + ChangeLog src/proto-p10.c + + 2004-10-16 21:14:11 GMT Michael Poole patch-82 Summary: diff --git a/src/proto-p10.c b/src/proto-p10.c index 37eb334..65eec3a 100644 --- a/src/proto-p10.c +++ b/src/proto-p10.c @@ -1847,12 +1847,13 @@ AddClone(const char *nick, const char *ident, const char *hostname, const char * int is_valid_nick(const char *nick) { + unsigned int ii; /* IRC has some of The Most Fucked-Up ideas about character sets * in the world.. */ if (!isalpha(*nick) && !strchr("{|}~[\\]^_`", *nick)) return 0; - for (++nick; *nick; ++nick) - if (!isalnum(*nick) && !strchr("{|}~[\\]^-_`", *nick)) + for (ii = 0; nick[ii]; ++ii) + if (!isalnum(nick[ii]) && !strchr("{|}~[\\]^-_`", nick[ii])) return 0; if (strlen(nick) > nicklen) return 0; -- 2.20.1