From 40a79d355864bd0431fc33719e00675f6a25b323 Mon Sep 17 00:00:00 2001 From: Will Cosgrove Date: Thu, 15 Mar 2018 16:53:58 -0700 Subject: [PATCH] Fixes incorrect indexing of KEX prefs string After stripping out an invalid KEX pref entry, it would incorrectly advance again leaving invalid values in the list. --- src/kex.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/kex.c b/src/kex.c index 6a34a712..4e47f2d0 100644 --- a/src/kex.c +++ b/src/kex.c @@ -3527,8 +3527,9 @@ libssh2_session_method_pref(LIBSSH2_SESSION * session, int method_type, } } } - - s = p ? (p + 1) : NULL; + else { + s = p ? (p + 1) : NULL; + } } if(strlen(newprefs) == 0) {