From: Patrik Weiskircher Date: Thu, 5 Jan 2006 19:15:33 +0000 (+0000) Subject: make sure session->hostname and session->port are valid before the X-Git-Tag: 1.2.beta1~756 X-Git-Url: http://git.silcnet.org/gitweb/?p=crypto.git;a=commitdiff_plain;h=8c4e6ad7be92c0783c657c0c3c64a9a1d1984939 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! --- 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; }