diff options
author | des <des@FreeBSD.org> | 2000-11-22 14:30:28 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2000-11-22 14:30:28 +0000 |
commit | f8ecb7b0f85a1f296164266d82869ccf21924afb (patch) | |
tree | f0906c4e63ffee61f1cd1a1403fd3d62aecf933c /lib/libfetch/ftp.c | |
parent | 77a68f50cdc9d5e959b66c6d15ab1c6cfc9a9cff (diff) | |
download | FreeBSD-src-f8ecb7b0f85a1f296164266d82869ccf21924afb.zip FreeBSD-src-f8ecb7b0f85a1f296164266d82869ccf21924afb.tar.gz |
Don't go haywire if the server closes the connection during a multiline
response.
Diffstat (limited to 'lib/libfetch/ftp.c')
-rw-r--r-- | lib/libfetch/ftp.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c index 3e56342..768cc74 100644 --- a/lib/libfetch/ftp.c +++ b/lib/libfetch/ftp.c @@ -140,9 +140,13 @@ _ftp_chkerr(int cd) } if (isftpinfo(last_reply)) { while (!isftpreply(last_reply)) { - if (_fetch_getln(cd, &last_reply, &lr_size, &lr_length) == -1) { + switch (_fetch_getln(cd, &last_reply, &lr_size, &lr_length)) { + case -1: _fetch_syserr(); return -1; + case 0: + _ftp_seterr(FTP_PROTOCOL_ERROR); + return -1; } } } |