1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

[svn] Handle invalid response to PWD gracefully.

This commit is contained in:
hniksic 2005-06-15 13:11:50 -07:00
parent 73ca5d585b
commit 4f22c2f567
2 changed files with 9 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2005-06-15 Hrvoje Niksic <hniksic@xemacs.org>
* ftp-basic.c (ftp_pwd): Handle malformed PWD response.
2005-06-15 Hrvoje Niksic <hniksic@xemacs.org>
* host.h (ip_address): Remove the trailing comma from the type

View File

@ -1081,6 +1081,7 @@ ftp_pwd (int csock, char **pwd)
return err;
if (*respline == '5')
{
err:
xfree (respline);
return FTPSRVERR;
}
@ -1089,6 +1090,10 @@ ftp_pwd (int csock, char **pwd)
and everything following it. */
strtok (respline, "\"");
request = strtok (NULL, "\"");
if (!request)
/* Treat the malformed response as an error, which the caller has
to handle gracefully anyway. */
goto err;
/* Has the `pwd' been already allocated? Free! */
xfree_null (*pwd);