Re: Segmentation fault in 3.0.3

"Alexander V. Lukyanov" <[email protected]>
Newsgroups gmane.network.lftp.devel
Message-ID <[email protected]>
On Tue, May 04, 2004 at 04:55:00PM +0800, Wang WenRui wrote:
>   There is segmentation fault when I connect to a ftp site. Again, this
>   is inconformity of the server software with RFCs. But lftp shouldn't
>   crash.

Thanks for report. Please try this patch, which also fixes 221 FEAT reply
issue too.

>   ---> FEAT
>   <--- 221-Extensions supported:
>   <---  REST STREAM
>   <---  SIZE
>   <---  MDTM
>   <---  TVFS
>   <---  HOST
>   <--- 221 End
>   **** remote end closed connection
>   ---- Closing control socket

--
   Alexander.                      | http://www.yars.free.net/~lav/
diff (text/plain, 935 B)
Index: ftpclass.cc
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/ftpclass.cc,v
retrieving revision 1.317
diff -u -p -r1.317 ftpclass.cc
--- ftpclass.cc	4 May 2004 11:58:35 -0000	1.317
+++ ftpclass.cc	6 May 2004 07:24:12 -0000
@@ -3082,6 +3082,8 @@ void Ftp::ExpectQueue::Push(Expect *e)
 }
 Ftp::Expect *Ftp::ExpectQueue::Pop()
 {
+   if(!first)
+      return 0;
    Expect *res=first;
    first=first->next;
    if(last==&res->next)
@@ -3510,6 +3512,7 @@ void Ftp::CheckResp(int act)
    if(is1XX(act)) // intermediate responses are ignored
       return;
 
+#if 0 // some broken servers use 221 code for FEAT.
    if(act==421 || act==221)  // timeout or something else
    {
       if(expect->IsEmpty() || !conn->quit_sent)
@@ -3517,6 +3520,7 @@ void Ftp::CheckResp(int act)
       DisconnectNow();
       return;
    }
+#endif
 
    Expect *exp=expect->Pop();
    if(!exp)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.