summaryrefslogtreecommitdiff
path: root/sftp-client.c
diff options
context:
space:
mode:
Diffstat (limited to 'sftp-client.c')
-rw-r--r--sftp-client.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sftp-client.c b/sftp-client.c
index cb4e0c4b1..e3c630837 100644
--- a/sftp-client.c
+++ b/sftp-client.c
@@ -1104,7 +1104,11 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path,
1104 local_path, strerror(errno)); 1104 local_path, strerror(errno));
1105 goto fail; 1105 goto fail;
1106 } 1106 }
1107 if (st.st_size > size) { 1107 if (st.st_size < 0) {
1108 error("\"%s\" has negative size", local_path);
1109 goto fail;
1110 }
1111 if ((u_int64_t)st.st_size > size) {
1108 error("Unable to resume download of \"%s\": " 1112 error("Unable to resume download of \"%s\": "
1109 "local file is larger than remote", local_path); 1113 "local file is larger than remote", local_path);
1110 fail: 1114 fail: