updates
authorPekka Riikonen <priikone@silcnet.org>
Fri, 2 Nov 2001 11:32:24 +0000 (11:32 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Fri, 2 Nov 2001 11:32:24 +0000 (11:32 +0000)
apps/silcd/command.c

index 59509fdda36d7fca1c2d65ebdee8220ba7b8e717..d0cb5316bbb171660520c3d943de30558c328e90 100644 (file)
@@ -3035,7 +3035,8 @@ static void silc_server_command_join_channel(SilcServer server,
      username and/or hostname is in the ban list the access to the
      channel is denied. */
   if (channel->ban_list) {
-    if (silc_string_match(channel->ban_list, check) ||
+    if (!channel->ban_list ||
+        silc_string_match(channel->ban_list, check) ||
        silc_string_match(channel->ban_list, check2)) {
       silc_server_command_send_status_reply(cmd, SILC_COMMAND_JOIN,
                              SILC_STATUS_ERR_BANNED_FROM_CHANNEL);
@@ -3052,8 +3053,9 @@ static void silc_server_command_join_channel(SilcServer server,
   
   /* Check the channel passphrase if set. */
   if (channel->mode & SILC_CHANNEL_MODE_PASSPHRASE) {
-    if (!passphrase || memcmp(channel->passphrase, passphrase,
-                             strlen(channel->passphrase))) {
+    if (!passphrase || !channel->passphrase ||
+        memcmp(channel->passphrase, passphrase,
+               strlen(channel->passphrase))) {
       silc_server_command_send_status_reply(cmd, SILC_COMMAND_JOIN,
                                            SILC_STATUS_ERR_BAD_PASSWORD);
       goto out;