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!
This commit is contained in:
Alexander Barton 2008-07-22 13:22:54 +02:00
parent 258143897c
commit b92a7627f3
1 changed files with 4 additions and 0 deletions

View File

@ -500,6 +500,10 @@ Channel_IsValidName( const char *Name )
{ {
assert( Name != NULL ); assert( Name != NULL );
#ifdef STRICT_RFC
if (strlen(Name) <= 1)
return false;
#endif
if (strchr("+#", Name[0]) == NULL) if (strchr("+#", Name[0]) == NULL)
return false; return false;
if (strlen(Name) >= CHANNEL_NAME_LEN) if (strlen(Name) >= CHANNEL_NAME_LEN)