From 3546131cd79c24403a5fff53f63b6aff677e4103 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Wed, 27 Apr 2005 08:48:44 +0000 Subject: [PATCH] Check for comma in invite/ban string. --- CHANGES | 5 +++++ apps/silcd/server_util.c | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 32546b97..50d30b83 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ +Wed Apr 27 11:49:41 EEST 2005 Pekka Riikonen + + * 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 * Moved silcer/, silc/, silcd/ and irssi/ to apps/. This diff --git a/apps/silcd/server_util.c b/apps/silcd/server_util.c index 1f202168..162cb06b 100644 --- a/apps/silcd/server_util.c +++ b/apps/silcd/server_util.c @@ -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); -- 2.24.0