diff options
author | Jakub Jelen <jjelen@redhat.com> | 2019-12-11 11:28:33 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2020-01-23 09:48:32 +0100 |
commit | 393cd36c0177e935312d26fea728e96bb8c9efaf (patch) | |
tree | 413477165b7bcb25de49244e4e3b114028de426f | |
parent | 93bf0ab6a358aedc551edde70d0ebd06843951a1 (diff) | |
download | libssh-393cd36c0177e935312d26fea728e96bb8c9efaf.tar.gz libssh-393cd36c0177e935312d26fea728e96bb8c9efaf.tar.xz libssh-393cd36c0177e935312d26fea728e96bb8c9efaf.zip |
kex: Avoid always-false comparisons as reported by csbuild
/builds/jjelen/libssh-mirror/src/kex.c:360:17: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] <--[cc]
360 | if (len < 0) {
| ^
/builds/jjelen/libssh-mirror/src/kex.c:372:17: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] <--[cc]
372 | if (len < 0) {
| ^
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit e2841908fbe5a236ab075ac0a13c26af96f5fe64)
-rw-r--r-- | src/kex.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -356,8 +356,8 @@ SSH_PACKET_CALLBACK(ssh_packet_kexinit) goto error; } - len = ssh_hashbufin_add_cookie(session, session->next_crypto->client_kex.cookie); - if (len < 0) { + ok = ssh_hashbufin_add_cookie(session, session->next_crypto->client_kex.cookie); + if (ok < 0) { ssh_set_error(session, SSH_FATAL, "ssh_packet_kexinit: adding cookie failed"); goto error; } @@ -368,8 +368,8 @@ SSH_PACKET_CALLBACK(ssh_packet_kexinit) goto error; } - len = ssh_hashbufin_add_cookie(session, session->next_crypto->server_kex.cookie); - if (len < 0) { + ok = ssh_hashbufin_add_cookie(session, session->next_crypto->server_kex.cookie); + if (ok < 0) { ssh_set_error(session, SSH_FATAL, "ssh_packet_kexinit: adding cookie failed"); goto error; } |