Re: Memory fault when SFTP transfer interrupted

"Alexander V. Lukyanov" <[email protected]> Thu, 14 May 2009 12:37:39 +0400
Newsgroups gmane.network.lftp.devel
Message-ID <[email protected]>
On Wed, May 13, 2009 at 12:51:38PM -0700, Iain Morgan wrote:
> interruption, I sent a SIGTERM to the ssh process or the remote
> sftp-server process. In either case, interrupting the transfer in such a
> manner caused lftp to die with a memory fault.

This patch should fix the problem.

--
   Alexander.
diff (text/plain, 469 B)
Index: SFtp.cc
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/SFtp.cc,v
retrieving revision 1.84
diff -u -p -r1.84 SFtp.cc
--- SFtp.cc	7 May 2009 07:54:05 -0000	1.84
+++ SFtp.cc	14 May 2009 08:21:18 -0000
@@ -1005,6 +1005,9 @@ int SFtp::HandleReplies()
    if(state!=CONNECTING_2)
       m|=HandlePty();

+   if(!recv_buf)
+      return MOVED;
+
    int i=0;
    Expect *ooo_scan=ooo_chain;
    while(ooo_scan)