gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnurl] 08/205: ftp: fixed a NULL pointer dereference on OO


From: gnunet
Subject: [GNUnet-SVN] [gnurl] 08/205: ftp: fixed a NULL pointer dereference on OOM
Date: Thu, 20 Apr 2017 16:19:08 +0200

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to annotated tag gnurl-7.54.0
in repository gnurl.

commit 516e60aa8e96c0b9a0364baa0f84a625e988b06f
Author: Dan Fandrich <address@hidden>
AuthorDate: Sat Feb 25 22:55:46 2017 +0100

    ftp: fixed a NULL pointer dereference on OOM
---
 lib/ftp.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/ftp.c b/lib/ftp.c
index 4d5d07a11..867c97994 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -2040,11 +2040,14 @@ static CURLcode ftp_state_pasv_resp(struct connectdata 
*conn,
     /* this just dumps information about this second connection */
     ftp_pasv_verbose(conn, addr->addr, ftpc->newhost, connectport);
 
+  Curl_resolv_unlock(data, addr); /* we're done using this address */
+
   Curl_safefree(conn->secondaryhostname);
-  conn->secondaryhostname = strdup(ftpc->newhost);
   conn->secondary_port = ftpc->newport;
+  conn->secondaryhostname = strdup(ftpc->newhost);
+  if(!conn->secondaryhostname)
+    return CURLE_OUT_OF_MEMORY;
 
-  Curl_resolv_unlock(data, addr); /* we're done using this address */
   conn->bits.do_more = TRUE;
   state(conn, FTP_STOP); /* this phase is completed */
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]