From:             [EMAIL PROTECTED]
Operating system: Linux
PHP version:      3.0.17
PHP Bug Type:     Other
Bug description:  FTP login connection with large banners on NT Server 4.0

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


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to