Don't assume the remote address in a 227 reply is enclosed in parentheses.

This commit is contained in:
Dag-Erling Smørgrav 2000-07-08 09:27:47 +00:00
parent c87a63c10f
commit 51e3d46ec0
1 changed files with 1 additions and 2 deletions

View File

@ -300,13 +300,12 @@ _ftp_transfer(int cd, char *oper, char *file,
* is IMHO the one and only weak point in the FTP protocol.
*/
ln = last_reply;
for (p = ln + 3; *p && *p != '('; p++)
for (p = ln + 3; *p && !isdigit(*p); p++)
/* nothing */ ;
if (!*p) {
e = 999;
goto ouch;
}
p++;
switch (e) {
case FTP_PASSIVE_MODE:
case FTP_LPASSIVE_MODE: