On Fri, 29 Mar 2013, Sam Deane wrote:

It seems to happen just after the third connection has been added.

Try the attached patch, also pushed to git. Makes the crash go away for me...

--

 / daniel.haxx.se
From ca62ac69bbda381b3ba3a7b8bca63e82e84743ab Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <[email protected]>
Date: Fri, 29 Mar 2013 21:19:45 +0100
Subject: [PATCH] ftp_sendquote: use PPSENDF, not FTPSENDF

The last remaining code piece that still used FTPSENDF now uses PPSENDF.
In the problematic case, a PREQUOTE series was done on a re-used
connection when Curl_pp_init() hadn't been called so it had messed up
pointers. The init call is done properly from Curl_pp_sendf() so this
change fixes this particular crash.

Bug: http://curl.haxx.se/mail/lib-2013-03/0319.html
Reported by: Sam Deane
---
 lib/ftp.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lib/ftp.c b/lib/ftp.c
index d9b8547..dec4800 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -162,8 +162,6 @@ static CURLcode ftp_dophase_done(struct connectdata *conn,
                                  bool connected);
 
 /* easy-to-use macro: */
-#define FTPSENDF(x,y,z)    if((result = Curl_ftpsendf(x,y,z)) != CURLE_OK) \
-                              return result
 #define PPSENDF(x,y,z)  if((result = Curl_pp_sendf(x,y,z)) != CURLE_OK) \
                               return result
 
@@ -3523,7 +3521,7 @@ CURLcode ftp_sendquote(struct connectdata *conn, struct curl_slist *quote)
         acceptfail = TRUE;
       }
 
-      FTPSENDF(conn, "%s", cmd);
+      PPSENDF(&conn->proto.ftpc.pp, "%s", cmd);
 
       pp->response = Curl_tvnow(); /* timeout relative now */
 
-- 
1.7.10.4

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to