summaryrefslogtreecommitdiffstats
path: root/lib/libfetch
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2001-04-07 15:26:31 +0000
committerdes <des@FreeBSD.org>2001-04-07 15:26:31 +0000
commita14b691e19c0cf1fa72557fdb74ec97158b014d1 (patch)
tree5895c641c281414b8fa7e78e498a0581e0a3c82b /lib/libfetch
parent7ead6384b7886989bdff69e5b0cd7d960b053f97 (diff)
downloadFreeBSD-src-a14b691e19c0cf1fa72557fdb74ec97158b014d1.zip
FreeBSD-src-a14b691e19c0cf1fa72557fdb74ec97158b014d1.tar.gz
If the server's reply to the SIZE command is unparseable, reset us->size
to -1 so the caller will know it's invalid. This is an MFC candidate.
Diffstat (limited to 'lib/libfetch')
-rw-r--r--lib/libfetch/ftp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c
index b866e78..a2dfc93 100644
--- a/lib/libfetch/ftp.c
+++ b/lib/libfetch/ftp.c
@@ -259,6 +259,7 @@ _ftp_stat(int cd, char *file, struct url_stat *us)
us->size = us->size * 10 + *ln - '0';
if (*ln && !isspace(*ln)) {
_ftp_seterr(FTP_PROTOCOL_ERROR);
+ us->size = -1;
return -1;
}
if (us->size == 0)
OpenPOWER on IntegriCloud