From 8c4e6ad7be92c0783c657c0c3c64a9a1d1984939 Mon Sep 17 00:00:00 2001 From: Patrik Weiskircher Date: Thu, 5 Jan 2006 19:15:33 +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. Patch received from Stefan Siegel , thanks! --- CHANGES | 8 ++++++++ lib/silcclient/client_ftp.c | 8 ++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index d92c5e24..3d58fd41 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,11 @@ +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! + Fri Dec 30 22:54:21 EET 2005 Pekka Riikonen * New SILC PKCS API enabling support for other public keys diff --git a/lib/silcclient/client_ftp.c b/lib/silcclient/client_ftp.c index e4e63da0..9eec9740 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