From bcc00eec9b2ebe07e13a360e7a18c9d70f84f71d Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 8 Oct 2012 20:34:19 +0200 Subject: kex: Don't compare an array to null. Found by Coverity. --- src/kex.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/kex.c b/src/kex.c index 46d5e53..4da4958 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]); } -- cgit