From 53afd4579828e69de231bc8bd337db5f45598aa0 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Sat, 1 Sep 2007 08:52:01 +0000 Subject: [PATCH] Fixed JOIN notify timeout handling, fixes a crash. --- lib/silcclient/client_notify.c | 9 +++++++-- lib/silcclient/command_reply.c | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/silcclient/client_notify.c b/lib/silcclient/client_notify.c index 5d431954..64c041ea 100644 --- a/lib/silcclient/client_notify.c +++ b/lib/silcclient/client_notify.c @@ -56,9 +56,14 @@ static void silc_client_notify_resolved(SilcClient client, /* If entry is still invalid, resolving failed. Finish notify processing. */ if (notify->client_entry && !notify->client_entry->internal.valid) { /* If resolving timedout try it again many times. */ - if (status != SILC_STATUS_ERR_TIMEDOUT || ++notify->resolve_retry > 1000) + if (status != SILC_STATUS_ERR_TIMEDOUT || ++notify->resolve_retry > 1000) { silc_fsm_next(notify->fsm, silc_client_notify_processed); - silc_client_unref_client(client, conn, notify->client_entry); + + /* Unref client only in case of non-timeout error. In case of timeout + occurred, the routine reprocessing the notify is expected not to + create new references of the entry. */ + silc_client_unref_client(client, conn, notify->client_entry); + } } /* If no entries found, just finish the notify processing */ diff --git a/lib/silcclient/command_reply.c b/lib/silcclient/command_reply.c index 9294fe8a..a487cb95 100644 --- a/lib/silcclient/command_reply.c +++ b/lib/silcclient/command_reply.c @@ -1997,6 +1997,8 @@ SILC_FSM_STATE(silc_client_command_reply_getkey) goto out; } if (!silc_public_key_payload_decode(tmp, len, &public_key)) { + SAY(client, conn, SILC_CLIENT_MESSAGE_COMMAND_ERROR, + "Cannot decode public key: malformed/unsupported public key"); ERROR_CALLBACK(SILC_STATUS_ERR_NOT_ENOUGH_PARAMS); goto out; } -- 2.24.0