From: Alexander Barton Date: Tue, 22 Jul 2008 11:22:54 +0000 (+0200) Subject: Don't allow empty channel names ("#") in strict RFC mode. X-Git-Tag: rel-13-rc1~83 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b92a7627f3dc6b85310964d4b602bea2509dade6;p=ngircd Don't allow empty channel names ("#") in strict RFC mode. This closes Bug #88. Patch proposed by Eric , but with wrong length comparision: please note that Channel_IsValidName() checks the name INCLUDING the prefix, so the test must be length<=1! --- diff --git a/src/ngircd/channel.c b/src/ngircd/channel.c index 58766810..aec6aa2d 100644 --- a/src/ngircd/channel.c +++ b/src/ngircd/channel.c @@ -500,6 +500,10 @@ Channel_IsValidName( const char *Name ) { assert( Name != NULL ); +#ifdef STRICT_RFC + if (strlen(Name) <= 1) + return false; +#endif if (strchr("+#", Name[0]) == NULL) return false; if (strlen(Name) >= CHANNEL_NAME_LEN)