diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2012-10-08 20:34:19 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2012-10-12 08:07:01 +0200 |
commit | bcc00eec9b2ebe07e13a360e7a18c9d70f84f71d (patch) | |
tree | 6d67b2896558d36bc64c7892763c009ab2eb64d9 /src | |
parent | 53008fb5d4708e956c7647dac25dabf74858cc59 (diff) | |
download | libssh-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.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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]); } |