1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 15:48:49 -05:00

SFTP: fix range request off-by-one in size check

Reported-by: Tim Stack

Closes #359
This commit is contained in:
Daniel Stenberg 2015-08-06 15:29:42 +02:00
parent 002d58f1e8
commit ade6682f8d

View File

@ -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);