Check for comma in invite/ban string.
authorPekka Riikonen <priikone@silcnet.org>
Wed, 27 Apr 2005 08:48:44 +0000 (08:48 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Wed, 27 Apr 2005 08:48:44 +0000 (08:48 +0000)
CHANGES
apps/silcd/server_util.c

diff --git a/CHANGES b/CHANGES
index 32546b970b09ee653dd8eb1a48b7cb727e0c604a..50d30b8382cf101939dd770a45b7b969d45435f2 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,8 @@
+Wed Apr 27 11:49:41 EEST 2005  Pekka Riikonen <priikone@silcnet.org>
+
+       * A comma in invite/ban string is invalid, check for it.
+         Affected file apps/silcd/server_util.c.
+
 Mon Apr 25 14:25:24 EEST 2005  Pekka Riikonen <priikone@silcnet.org>
 
        * Moved silcer/, silc/, silcd/ and irssi/ to apps/.  This
index 1f202168f5e55317be877f49083c5c4e1d1caa16..162cb06b7c6fd444ef2f696e939ca238d8fb76f7 100644 (file)
@@ -1893,11 +1893,16 @@ bool silc_server_inviteban_process(SilcServer server, SilcHashTable list,
     tmp = silc_argument_get_first_arg(args, &type, &len);
     while (tmp) {
       if (type == 1) {
-       /* Check validity of the string */
+       /* Check validity of the string.  Actually we should parse the 
+          whole string and verify all components individually. */
        if (!silc_utf8_valid(tmp, len) || !len) {
          tmp = silc_argument_get_next_arg(args, &type, &len);
          continue;
        }
+       if (strchr(tmp, ',')) {
+         tmp = silc_argument_get_next_arg(args, &type, &len);
+         continue;
+       }
 
        /* Check if the string is added already */
        silc_hash_table_list(list, &htl);
@@ -1978,11 +1983,16 @@ bool silc_server_inviteban_process(SilcServer server, SilcHashTable list,
     tmp = silc_argument_get_first_arg(args, &type, &len);
     while (tmp) {
       if (type == 1) {
-       /* Check validity of the string */
+       /* Check validity of the string.  Actually we should parse the 
+          whole string and verify all components individually. */
        if (!silc_utf8_valid(tmp, len)) {
          tmp = silc_argument_get_next_arg(args, &type, &len);
          continue;
        }
+       if (strchr(tmp, ',')) {
+         tmp = silc_argument_get_next_arg(args, &type, &len);
+         continue;
+       }
 
        /* Delete from the list */
        silc_hash_table_list(list, &htl);