]> arthur.barton.de Git - ngircd.git/commitdiff
Don't allow empty channel names ("#") in strict RFC mode.
authorAlexander Barton <alex@barton.de>
Tue, 22 Jul 2008 11:22:54 +0000 (13:22 +0200)
committerAlexander Barton <alex@barton.de>
Tue, 22 Jul 2008 11:24:14 +0000 (13:24 +0200)
This closes Bug #88.

Patch proposed by Eric <egrunow@ucsd.edu>, but with wrong length
comparision: please note that Channel_IsValidName() checks the name
INCLUDING the prefix, so the test must be length<=1!

src/ngircd/channel.c

index 587668105ff36340cb884b97ae3a28793e42d1c7..aec6aa2da9e9a6b686535040e46432099c424fd0 100644 (file)
@@ -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)