From daa6792e25454f5783f0545384590ef122a3878f Mon Sep 17 00:00:00 2001 From: Patrik Weiskircher Date: Thu, 5 Jan 2006 19:10:36 +0000 Subject: [PATCH] make sure session->hostname and session->port are valid before the application callback is done, since things will go wrong if the application immediately calls silc_client_file_receive. --- CHANGES | 9 ++++++++- lib/silcclient/client_ftp.c | 8 ++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index ca3d9044..862cb32f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,12 @@ -Wed Dec 14 19:21:42 CET 2005 Jochen Eisinger +Thu Jan 5 20:02:31 CET 2006 Patrik Weiskircher + * make sure session->hostname and session->port are valid before the + application callback is done, since things will go wrong if the + application immediately calls silc_client_file_receive. Affected + file lib/silcclient/client_ftp.c. + Patch received from Stefan Siegel , thanks! + +Wed Dec 14 19:21:42 CET 2005 Jochen Eisinger * Fixed autodist configuration for silc-client. Affected file configure.ad * Honor user set hostname. Also give the user a chance to diff --git a/lib/silcclient/client_ftp.c b/lib/silcclient/client_ftp.c index 3e71b5ab..6081fac6 100644 --- a/lib/silcclient/client_ftp.c +++ b/lib/silcclient/client_ftp.c @@ -1155,15 +1155,15 @@ static void silc_client_ftp_resolve_cb(SilcClient client, session->client_entry = client_entry; silc_dlist_add(conn->internal->ftp_sessions, session); - /* Let the application know */ - client->internal->ops->ftp(client, conn, client_entry, - session->session_id, hostname, port); - if (hostname && port) { session->hostname = strdup(hostname); session->port = port; } + /* Let the application know */ + client->internal->ops->ftp(client, conn, client_entry, + session->session_id, hostname, port); + goto out; } -- 2.24.0