gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnurl] 143/178: ssh-libssh.c: fix left shift compiler warn


From: gnunet
Subject: [GNUnet-SVN] [gnurl] 143/178: ssh-libssh.c: fix left shift compiler warning
Date: Wed, 23 May 2018 12:26:18 +0200

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository gnurl.

commit 1156fdd01dcb7751081ea07603812666e5bbe6b7
Author: Daniel Stenberg <address@hidden>
AuthorDate: Thu May 3 22:16:57 2018 +0200

    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.
---
 lib/ssh-libssh.c | 3 +--
 1 file changed, 1 insertion(+), 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:

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]