From: Pekka Riikonen Date: Mon, 27 Aug 2001 13:08:17 +0000 (+0000) Subject: updates. X-Git-Tag: silcertest~142 X-Git-Url: http://git.silcnet.org/gitweb/?a=commitdiff_plain;h=011072dfc9cd98d8de2a1ae0d7be260118506635;p=silc.git updates. --- diff --git a/CHANGES b/CHANGES index 8f8b281b..1e24bc44 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,10 @@ +Sun Aug 26 14:59:15 EEST 2001 Pekka Riikonen + + * 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 * Fixed the getkey command handling in the server. Send just diff --git a/lib/silcclient/client.c b/lib/silcclient/client.c index 42765c94..02288635 100644 --- a/lib/silcclient/client.c +++ b/lib/silcclient/client.c @@ -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; } diff --git a/lib/silcclient/command_reply.c b/lib/silcclient/command_reply.c index e7d65302..61bade4b 100644 --- a/lib/silcclient/command_reply.c +++ b/lib/silcclient/command_reply.c @@ -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; }