wininet: More lenient parsing of the passive mode server response.

oldstable
Hans Leidekker 2007-06-07 16:32:24 +02:00 committed by Alexandre Julliard
parent a2daceb7c2
commit 9a6ba225e2
1 changed files with 3 additions and 10 deletions

View File

@ -2545,18 +2545,11 @@ static BOOL FTP_DoPassive(LPWININETFTPSESSIONW lpwfs)
struct sockaddr_in dataSocketAddress;
p = lpszResponseBuffer+4; /* skip status code */
while (*p != '\0' && (*p < '0' || *p > '9')) p++;
/* do a very strict check; we can improve that later. */
if (strncmp(p, "Entering Passive Mode", 21))
if (*p == '\0')
{
ERR("unknown response '%.*s', aborting\n", 21, p);
goto lend;
}
p += 21; /* skip string */
if ((*p++ != ' ') || (*p++ != '('))
{
ERR("unknown response format, aborting\n");
ERR("no address found in response, aborting\n");
goto lend;
}