]> granicus.if.org Git - curl/commitdiff
SFTP: fix range request off-by-one in size check
authorDaniel Stenberg <daniel@haxx.se>
Thu, 6 Aug 2015 13:29:42 +0000 (15:29 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 10 Aug 2015 07:18:19 +0000 (09:18 +0200)
Reported-by: Tim Stack
Closes #359

lib/ssh.c

index 7b0e57c2c90aab331b912451deaa8884d3c0a88a..94195a7b69c59f08830a3029e1b90c1349773152 100644 (file)
--- 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);