Little for loop fix in silc_server_command_whois_parse.
authorPekka Riikonen <priikone@silcnet.org>
Wed, 14 Feb 2001 21:15:40 +0000 (21:15 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Wed, 14 Feb 2001 21:15:40 +0000 (21:15 +0000)
CHANGES
apps/silcd/command.c

diff --git a/CHANGES b/CHANGES
index ad7c04272c3637bbfaeb244fedc26b6eafba444a..42d244452a05879a754f59bb2fbf9fa14cbbb998 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -41,6 +41,12 @@ Wed Feb 14 16:03:25 EET 2001  Pekka Riikonen <priikone@poseidon.pspt.fi>
          global ID list for the channel as it might not be in the local
          list.  Fixed a bug related to LEAVE command.
 
+       * Is this the end of the [<unknown>] buglet that has been lurking
+         around for a long time?  A little for loop fix in server's
+         silc_server_command_whois_parse that is used by both IDENTIFY
+         and WHOIS command.  At least, this was a clear bug and a cause
+         of one type of [<unknown>] buglet.
+
 Tue Feb 13 19:55:59 EET 2001  Pekka Riikonen <priikone@poseidon.pspt.fi>
 
        * Added --with-gmp configuration option.  If set the GMP
index 3241d595406245020f09e3cc794c5c79f1812161..b1cc5c1e32d019f30a5239c0197df24b9532c9e3 100644 (file)
@@ -359,14 +359,15 @@ silc_server_command_whois_parse(SilcServerCommandContext cmd,
 
     /* Take all ID's from the command packet */
     if (argc > 3) {
-      for (k = 1, i = 4; i < argc; i++) {
+      for (k = 1, i = 4; i < argc + 1; i++) {
        tmp = silc_argument_get_arg_type(cmd->args, i, &len);
        if (tmp) {
          *client_id = silc_realloc(*client_id, sizeof(**client_id) *
                                    (*client_id_count + 1));
          (*client_id)[k] = silc_id_payload_parse_id(tmp, len);
          if ((*client_id)[k] == NULL) {
-           for (i = 0; i < k; i++)
+           /* Cleanup all and fail */
+           for (i = 0; i < *client_id_count; i++)
              silc_free((*client_id)[i]);
            silc_free(*client_id);
            return FALSE;