From 5417a72536954927371d597e9a4e0453e70620e3 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Mon, 28 Feb 2011 21:09:47 +0100 Subject: [PATCH] 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. --- src/ngircd/channel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ngircd/channel.c b/src/ngircd/channel.c index d1f9c6c9..6e8851b6 100644 --- a/src/ngircd/channel.c +++ b/src/ngircd/channel.c @@ -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)