Invite/ban list length checks.
[silc.git] / apps / silcd / command.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);