Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=703197eb5b5c781fef6534e09f57c7d7a6f347b4

commit 703197eb5b5c781fef6534e09f57c7d7a6f347b4
Author: crazy <[email protected]>
Date:   Fri Oct 9 15:14:18 2015 +0200

libftp/ftplib.c - fix a "dereference after free"
* from James Buren <[email protected]>

diff --git a/lib/libftp/ftplib.c b/lib/libftp/ftplib.c
index 0a32291..f43c0a2 100644
--- a/lib/libftp/ftplib.c
+++ b/lib/libftp/ftplib.c
@@ -956,6 +956,7 @@ GLOBALDEF int FtpWrite(void *buf, int len, netbuf *nData)
GLOBALDEF int FtpClose(netbuf *nData)
{
netbuf *ctrl;
+       int errcode;
switch (nData->dir)
{
case FTPLIB_WRITE:
@@ -968,8 +969,9 @@ GLOBALDEF int FtpClose(netbuf *nData)
shutdown(nData->handle,2);
net_close(nData->handle);
ctrl = nData->ctrl;
+                       errcode = nData->errcode;
free(nData);
-                       if (ctrl && (nData->errcode != ETIMEDOUT))
+                       if (ctrl && (errcode != ETIMEDOUT))
{
ctrl->data = NULL;
return(readresp('2', ctrl));
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to