channel: always reject zero-length channel key
previously, any client could join in this configuration: [Channel] Name = #test Modes = tnk KeyFile = /tmp/foobar fix this by checking for zero-length key before comparing key to channel key.
This commit is contained in:
parent
94e4562c1c
commit
5417a72536
|
@ -1082,10 +1082,10 @@ Channel_CheckKey(CHANNEL *Chan, CLIENT *Client, const char *Key)
|
|||
|
||||
if (!strchr(Chan->modes, 'k'))
|
||||
return true;
|
||||
if (strcmp(Chan->key, Key) == 0)
|
||||
return true;
|
||||
if (*Key == '\0')
|
||||
return false;
|
||||
if (strcmp(Chan->key, Key) == 0)
|
||||
return true;
|
||||
|
||||
file_name = array_start(&Chan->keyfile);
|
||||
if (!file_name)
|
||||
|
|
Loading…
Reference in New Issue