From 1c541e578777af1f94fd0e53b608cf7c0f5bdaeb Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Sat, 7 Sep 2002 13:03:03 +0000 Subject: [PATCH] Mark cache->expire = 0 in JOIN notify handling to assure that client is not expired underneath the channel. --- CHANGES | 7 +++++++ apps/silcd/packet_receive.c | 10 +++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 11270f2f..eef3eac5 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,10 @@ +Sat Sep 7 16:02:09 EEST 2002 Pekka Riikonen + + * In JOIN notify handling, mark that the cache entry of the + client cannot be expired. Can cause crashes on normal + server (asserts client->channels). Affected file is + silcd/packet_receive.c. + Sat Sep 7 14:22:43 CEST 2002 Lubomir Sedlacik * Rewritten check for POSIX threads. Use --with-pthreads[=DIR] diff --git a/apps/silcd/packet_receive.c b/apps/silcd/packet_receive.c index 2068c18b..c0bda143 100644 --- a/apps/silcd/packet_receive.c +++ b/apps/silcd/packet_receive.c @@ -43,7 +43,7 @@ void silc_server_notify(SilcServer server, SilcClientEntry client = NULL, client2 = NULL; SilcServerEntry server_entry = NULL; SilcChannelClientEntry chl; - SilcIDCacheEntry cache; + SilcIDCacheEntry cache = NULL; SilcHashTableList htl; SilcUInt32 mode; unsigned char *tmp; @@ -166,11 +166,11 @@ void silc_server_notify(SilcServer server, entry for the client. */ client = silc_idlist_find_client_by_id(server->global_list, client_id, server->server_type, - NULL); + &cache); if (!client) { client = silc_idlist_find_client_by_id(server->local_list, client_id, server->server_type, - NULL); + &cache); if (!client) { /* If router did not find the client the it is bogus */ if (server->server_type != SILC_SERVER) { @@ -239,6 +239,10 @@ void silc_server_notify(SilcServer server, channel->user_count++; channel->disabled = FALSE; + /* Make sure we don't expire clients that are on channel */ + if (cache) + cache->expire = 0; + /* Update statistics */ if (server->server_type == SILC_ROUTER) { if (sock->type != SILC_SOCKET_TYPE_ROUTER) -- 2.24.0