]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
libssh2: comparison is always true because rc <= -1
authorDaniel Stenberg <daniel@haxx.se>
Sat, 8 Feb 2025 21:47:50 +0000 (22:47 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 8 Feb 2025 22:24:08 +0000 (23:24 +0100)
Pointed out by CodeQL

Closes #16268

lib/vssh/libssh2.c

index 1707e6d5d929df0cb76c85911b62480ee6f0806c..4a67edc514109e4b637d633c246ded15b2118872 100644 (file)
@@ -1633,10 +1633,10 @@ static CURLcode sftp_readdir(struct Curl_easy *data,
       return result;
     }
   }
-  else if(rc == 0) {
+  else if(!rc) {
     state(data, SSH_SFTP_READDIR_DONE);
   }
-  else if(rc < 0) {
+  else {
     unsigned long sftperr = libssh2_sftp_last_error(sshc->sftp_session);
     result = sftp_libssh2_error_to_CURLE(sftperr);
     sshc->actualcode = result ? result : CURLE_SSH;