aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2012-10-08 20:34:19 +0200
committerAndreas Schneider <asn@cryptomilk.org>2012-10-12 08:07:01 +0200
commitbcc00eec9b2ebe07e13a360e7a18c9d70f84f71d (patch)
tree6d67b2896558d36bc64c7892763c009ab2eb64d9 /src
parent53008fb5d4708e956c7647dac25dabf74858cc59 (diff)
downloadlibssh-bcc00eec9b2ebe07e13a360e7a18c9d70f84f71d.tar.gz
libssh-bcc00eec9b2ebe07e13a360e7a18c9d70f84f71d.tar.xz
libssh-bcc00eec9b2ebe07e13a360e7a18c9d70f84f71d.zip
kex: Don't compare an array to null.
Found by Coverity.
Diffstat (limited to 'src')
-rw-r--r--src/kex.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/kex.c b/src/kex.c
index 46d5e539..4da4958b 100644
--- a/src/kex.c
+++ b/src/kex.c
@@ -338,11 +338,11 @@ void ssh_list_kex(ssh_session session, struct ssh_kex_struct *kex) {
#ifdef DEBUG_CRYPTO
ssh_print_hexa("session cookie", kex->cookie, 16);
#endif
- if(kex->methods==NULL){
- ssh_log(session, SSH_LOG_RARE,"kex->methods is NULL");
- return;
- }
+
for(i = 0; i < SSH_KEX_METHODS; i++) {
+ if (kex->methods[i] == NULL) {
+ continue;
+ }
ssh_log(session, SSH_LOG_FUNCTIONS, "%s: %s",
ssh_kex_nums[i], kex->methods[i]);
}