From 54cd27a50da79fc6608abf2ab0dad15e52818430 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 8 Feb 2025 22:47:50 +0100 Subject: [PATCH] libssh2: comparison is always true because rc <= -1 Pointed out by CodeQL Closes #16268 --- lib/vssh/libssh2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index 1707e6d5d9..4a67edc514 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -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; -- 2.47.3