diff options
| author | Alexander Barton <alex@barton.de> | 2008-07-22 13:22:54 +0200 |
|---|---|---|
| committer | Alexander Barton <alex@barton.de> | 2008-07-22 13:24:14 +0200 |
| commit | b92a7627f3dc6b85310964d4b602bea2509dade6 (patch) | |
| tree | bb49d1569d5494585ce1010a22f9c5cb67a61a0b /src | |
| parent | 258143897ca1a4cbc8b97c9691a0cf83b963705a (diff) | |
| download | ngircd-b92a7627f3dc6b85310964d4b602bea2509dade6.tar.gz ngircd-b92a7627f3dc6b85310964d4b602bea2509dade6.zip | |
Don't allow empty channel names ("#") in strict RFC mode.
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!
Diffstat (limited to 'src')
| -rw-r--r-- | src/ngircd/channel.c | 4 |
1 files changed, 4 insertions, 0 deletions
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) |