diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | sftp-client.c | 6 |
2 files changed, 6 insertions, 1 deletions
@@ -3,6 +3,7 @@ | |||
3 | hardening flags including -fstack-protector-strong. These default to on | 3 | hardening flags including -fstack-protector-strong. These default to on |
4 | if the toolchain supports them, but there is a configure-time knob | 4 | if the toolchain supports them, but there is a configure-time knob |
5 | (--without-hardening) to disable them if necessary. ok djm@ | 5 | (--without-hardening) to disable them if necessary. ok djm@ |
6 | - (djm) [sftp-client.c] signed/unsigned comparison fix | ||
6 | 7 | ||
7 | 20140118 | 8 | 20140118 |
8 | - (djm) OpenBSD CVS Sync | 9 | - (djm) OpenBSD CVS Sync |
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: |