Invite/ban list length checks.
authorPekka Riikonen <priikone@silcnet.org>
Tue, 26 Nov 2002 08:33:20 +0000 (08:33 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Tue, 26 Nov 2002 08:33:20 +0000 (08:33 +0000)
apps/silcd/command.c
apps/silcd/packet_receive.c
apps/silcd/server_util.c

index c053236d89e04fc73886ac5d8f8d727ce92a4305..e5f6d0a40410a72789ba8abd4374d567ddbf0055 100644 (file)
@@ -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);
index 7f3a8ba92f9be64938ef46235d01edbbdd4e4fb0..5bd89cce9ffba925a78e03d8444e66f281cdb7ed 100644 (file)
@@ -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 */
index 790979cdf208808b9f5ec6706291010420d357c4..1c8dd181771da0b40fd150ef4e466bf15bcff7f0 100644 (file)
@@ -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) {