]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/channel.c
channel: always reject zero-length channel key
[ngircd-alex.git] / src / ngircd / channel.c
index d1f9c6c9790a17748b1a37dbed6ae3bb24e69a84..6e8851b64113b44c4b5dd7e47faf370dba0f6675 100644 (file)
@@ -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)