From: Pekka Riikonen Date: Tue, 26 Nov 2002 08:33:20 +0000 (+0000) Subject: Invite/ban list length checks. X-Git-Tag: silc.server.0.9.6~8 X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=commitdiff_plain;h=8e1bcf91e119deb125ee1ff058907e563d9d245b Invite/ban list length checks. --- diff --git a/apps/silcd/command.c b/apps/silcd/command.c index c053236d..e5f6d0a4 100644 --- a/apps/silcd/command.c +++ b/apps/silcd/command.c @@ -1173,7 +1173,7 @@ SILC_SERVER_CMD_FUNC(invite) /* Get the invite information */ tmp = silc_argument_get_arg_type(cmd->args, 4, &len); - if (tmp) { + if (tmp && len > 2) { /* Parse the arguments to see they are constructed correctly */ SILC_GET16_MSB(argc, tmp); args = silc_argument_payload_parse(tmp + 2, len - 2, argc); @@ -4148,7 +4148,7 @@ SILC_SERVER_CMD_FUNC(ban) /* Get the ban information */ tmp = silc_argument_get_arg_type(cmd->args, 3, &len); - if (tmp) { + if (tmp && len > 2) { /* Parse the arguments to see they are constructed correctly */ SILC_GET16_MSB(argc, tmp); args = silc_argument_payload_parse(tmp + 2, len - 2, argc); diff --git a/apps/silcd/packet_receive.c b/apps/silcd/packet_receive.c index 7f3a8ba9..5bd89cce 100644 --- a/apps/silcd/packet_receive.c +++ b/apps/silcd/packet_receive.c @@ -1076,7 +1076,7 @@ void silc_server_notify(SilcServer server, /* Get invite list */ tmp = silc_argument_get_arg_type(args, 5, &tmp_len); - if (!tmp) + if (!tmp || tmp_len < 2) goto out; /* Parse the arguments to see they are constructed correctly */ @@ -1650,7 +1650,7 @@ void silc_server_notify(SilcServer server, /* Get ban list */ tmp = silc_argument_get_arg_type(args, 3, &tmp_len); - if (!tmp) + if (!tmp || tmp_len < 2) goto out; /* Parse the arguments to see they are constructed correctly */ diff --git a/apps/silcd/server_util.c b/apps/silcd/server_util.c index 790979cd..1c8dd181 100644 --- a/apps/silcd/server_util.c +++ b/apps/silcd/server_util.c @@ -1854,7 +1854,7 @@ void silc_server_inviteban_process(SilcServer server, SilcHashTable list, } /* Delete information to invite list */ - if (action && list) { + if (action == 0x01 && list) { /* Now delete the arguments from invite list */ tmp = silc_argument_get_first_arg(args, &type, &len); while (tmp) {