php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9770 FTP login connection with large banners on NT Server 4.0
Submitted: 2001-03-15 13:07 UTC Modified: 2005-03-31 16:13 UTC
From: ulisses at skyborg dot com Assigned:
Status: Wont fix Package: Other
PHP Version: 3.0.17 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ulisses at skyborg dot com
New email:
PHP Version: OS:

 

 [2001-03-15 13:07 UTC] ulisses at skyborg dot com
While connecting with a NT FTP Server 4.0 with a banner message with several lines the function ftp_login always returns a warning error.
I debug the source code and found a bug on file funcions/ftp.c on function int ftp_getresp(ftpbuf_t *ftp)
If the function receive a blank line the loop below is aborted

while (1) {
    if (!ftp_readline(ftp))
       return 0;
    if (ftp->inbuf[3] == '-')
        continue;
    else if (ftp->inbuf[3] != ' ') 
        return 0;
    break;
}

I think I resolved the problem (it works with my application) adding a line to this loop:

while (1) {
    if (!ftp_readline(ftp))
       return 0;
    if (ftp->inbuf[3] == '-')
        continue;
    else if (ftp->inbuf[0]==0) continue;
    else if (ftp->inbuf[3] != ' ') 
        return 0;
    break;
}


I hope I could help you.

Ulisses Donato

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-31 16:13 UTC] php-bugs at lists dot php dot net
We are sorry, but we do not support PHP 3 related problems anymore.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 08:01:28 2024 UTC