From ade6682f8d90164450ab64f3ac17f590206e1553 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 6 Aug 2015 15:29:42 +0200 Subject: SFTP: fix range request off-by-one in size check Reported-by: Tim Stack Closes #359 --- lib/ssh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ssh.c b/lib/ssh.c index 7b0e57c2c..94195a7b6 100644 --- a/lib/ssh.c +++ b/lib/ssh.c @@ -2144,7 +2144,7 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block) /* from is relative to end of file */ from += size; } - if(from >= size) { + if(from > size) { failf(data, "Offset (%" CURL_FORMAT_CURL_OFF_T ") was beyond file size (%" CURL_FORMAT_CURL_OFF_T ")", from, attrs.filesize); -- cgit v1.2.3