summaryrefslogtreecommitdiff
path: root/sftp-client.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2014-01-17 11:20:26 +1100
committerDamien Miller <djm@mindrot.org>2014-01-17 11:20:26 +1100
commitc3d483f9a8275be1113535a1e0d0e384f605f3c4 (patch)
treecce83e6e2b00a14448d8ff5f7fc962bfdb2b0ab5 /sftp-client.c
parentfd994379dd972417d0491767f7cd9b5bf23f4975 (diff)
- (djm) [sftp-client.c] signed/unsigned comparison fix
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: