Skip to content

Commit

Permalink
SFTP: fix range request off-by-one in size check
Browse files Browse the repository at this point in the history
Reported-by: Tim Stack

Closes #359
  • Loading branch information
bagder committed Aug 10, 2015
1 parent 002d58f commit ade6682
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ssh.c
Expand Up @@ -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);
Expand Down

0 comments on commit ade6682

Please sign in to comment.