diff options
author | des <des@FreeBSD.org> | 2001-04-07 15:26:31 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2001-04-07 15:26:31 +0000 |
commit | a14b691e19c0cf1fa72557fdb74ec97158b014d1 (patch) | |
tree | 5895c641c281414b8fa7e78e498a0581e0a3c82b /lib/libfetch | |
parent | 7ead6384b7886989bdff69e5b0cd7d960b053f97 (diff) | |
download | FreeBSD-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.c | 1 |
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) |