commit | c3d483f9a8275be1113535a1e0d0e384f605f3c4 | [log] [tgz] |
---|---|---|
author | Damien Miller <djm@mindrot.org> | Fri Jan 17 11:20:26 2014 +1100 |
committer | Damien Miller <djm@mindrot.org> | Fri Jan 17 11:20:26 2014 +1100 |
tree | cce83e6e2b00a14448d8ff5f7fc962bfdb2b0ab5 | |
parent | fd994379dd972417d0491767f7cd9b5bf23f4975 [diff] [blame] |
- (djm) [sftp-client.c] signed/unsigned comparison fix
diff --git a/sftp-client.c b/sftp-client.c index cb4e0c4..e3c6308 100644 --- a/sftp-client.c +++ b/sftp-client.c
@@ -1104,7 +1104,11 @@ local_path, strerror(errno)); goto fail; } - if (st.st_size > size) { + if (st.st_size < 0) { + error("\"%s\" has negative size", local_path); + goto fail; + } + if ((u_int64_t)st.st_size > size) { error("Unable to resume download of \"%s\": " "local file is larger than remote", local_path); fail: