make sure session->hostname and session->port are valid before the
authorPatrik Weiskircher <pat@silcnet.org>
Thu, 5 Jan 2006 19:15:33 +0000 (19:15 +0000)
committerPatrik Weiskircher <pat@silcnet.org>
Thu, 5 Jan 2006 19:15:33 +0000 (19:15 +0000)
application callback is done, since things will go wrong if the
application immediately calls silc_client_file_receive.
Patch received from Stefan Siegel <stesie@brokenpipe.de>, thanks!

CHANGES
lib/silcclient/client_ftp.c

diff --git a/CHANGES b/CHANGES
index d92c5e2401b7bae4f666c98311116d7ec6671759..3d58fd411f278f7a6dcbcdd52f3c4154acc3646f 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,11 @@
+Thu Jan  5 20:02:31 CET 2006 Patrik Weiskircher <pat@icore.at>
+
+       * 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 <stesie@brokenpipe.de>, thanks!
+
 Fri Dec 30 22:54:21 EET 2005  Pekka Riikonen <priikone@silcnet.org>
 
        * New SILC PKCS API enabling support for other public keys
index e4e63da06ae86c092bac6a0704ba4cf382573e10..9eec97400df16a58c9b9612ec67c2bcca9b23cad 100644 (file)
@@ -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;
   }