updates.
authorPekka Riikonen <priikone@silcnet.org>
Mon, 27 Aug 2001 13:08:17 +0000 (13:08 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Mon, 27 Aug 2001 13:08:17 +0000 (13:08 +0000)
CHANGES
lib/silcclient/client.c
lib/silcclient/command_reply.c

diff --git a/CHANGES b/CHANGES
index 8f8b281bf37ecf16bc5c40cdc48db6ad6c2c1b35..1e24bc44bf226b5a0f22dda29b151a2f2378836a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,10 @@
+Sun Aug 26 14:59:15 EEST 2001  Pekka Riikonen <priikone@silcnet.org>
+
+       * Fixed a bug in silc_client_command_identify_save when saving
+         new channel information.  The channel name was no duplicated
+         and caused crash on exit.  Affected file is
+         lib/silcclient/command_reply.c.
+
 Fri Aug 17 23:07:45 EEST 2001  Pekka Riikonen <priikone@silcnet.org>
 
        * Fixed the getkey command handling in the server.  Send just
index 42765c942a98dcdfbf3686127611284134e73a10..02288635a09430bf86f33ccca7fbcbe52fed550f 100644 (file)
@@ -1377,8 +1377,8 @@ SilcChannelEntry silc_client_new_channel_id(SilcClient client,
   silc_list_init(channel->clients, struct SilcChannelUserStruct, next);
 
   /* Put it to the ID cache */
-  silc_idcache_add(conn->channel_cache, channel_name, (void *)channel->id
-                  (void *)channel, FALSE);
+  silc_idcache_add(conn->channel_cache, channel->channel_name
+                  (void *)channel->id, (void *)channel, FALSE);
 
   return channel;
 }
index e7d6530231b181bf61dc8a5afc6f919d6b88ac88..61bade4bbce963df43c4e7fef712ae50d76329da 100644 (file)
@@ -527,7 +527,8 @@ silc_client_command_reply_identify_save(SilcClientCommandReplyContext cmd,
       
       server_entry = silc_calloc(1, sizeof(*server_entry));
       server_entry->server_id = silc_id_dup(server_id, id_type);
-      server_entry->server_name = strdup(name);
+      if (name)
+       server_entry->server_name = strdup(name);
       if (info)
        server_entry->server_info = strdup(info);
       
@@ -550,9 +551,12 @@ silc_client_command_reply_identify_save(SilcClientCommandReplyContext cmd,
     /* Check if we have this channel cached already. */
     if (!silc_idcache_find_by_id_one(conn->channel_cache, 
                                     (void *)channel_id, &id_cache)) {
+      if (!name)
+       break;
+
       SILC_LOG_DEBUG(("Adding new channel entry"));
       channel_entry = silc_client_new_channel_id(client, conn->sock, 
-                                                name, 0, idp);
+                                                strdup(name), 0, idp);
     } else {
       channel_entry = (SilcChannelEntry)id_cache->context;
     }