diff options
author | Daniel Stenberg <daniel@haxx.se> | 2018-05-03 22:16:57 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2018-05-03 22:16:57 +0200 |
commit | 1156fdd01dcb7751081ea07603812666e5bbe6b7 (patch) | |
tree | 020348d4f14847891829b64d33ede588883bdd44 /lib | |
parent | 7f41432c191c70f7f782802cd17e95e87a9a7671 (diff) | |
download | curl-1156fdd01dcb7751081ea07603812666e5bbe6b7.tar.gz |
ssh-libssh.c: fix left shift compiler warning
ssh-libssh.c:2429:21: warning: result of '1 << 31' requires 33 bits to
represent, but 'int' only has 32 bits [-Wshift-overflow=]
'len' will never be that big anyway so I converted the run-time check to
a regular assert.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ssh-libssh.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/ssh-libssh.c b/lib/ssh-libssh.c index 9e6667295..34ef490c4 100644 --- a/lib/ssh-libssh.c +++ b/lib/ssh-libssh.c @@ -2425,8 +2425,7 @@ static ssize_t sftp_recv(struct connectdata *conn, int sockindex, ssize_t nread; (void)sockindex; - if(len >= (size_t)1<<32) - len = (size_t)(1<<31)-1; + DEBUGASSERT(len < CURL_MAX_READ_SIZE); switch(conn->proto.sshc.sftp_recv_state) { case 0: |