Skip to content

Commit

Permalink
kex.c: make sure mlist is not set to NULL
Browse files Browse the repository at this point in the history
... if the currently unsupported LANG methods are called.
Reported by Coverity CID 89834.
  • Loading branch information
mback2k committed Dec 26, 2014
1 parent dc199ed commit 3835655
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/kex.c
Original file line number Diff line number Diff line change
Expand Up @@ -1866,7 +1866,7 @@ libssh2_session_method_pref(LIBSSH2_SESSION * session, int method_type,
}
memcpy(s, prefs, prefs_len + 1);

while (s && *s) {
while (s && *s && mlist) {
char *p = strchr(s, ',');
int method_len = p ? (p - s) : (int) strlen(s);

Expand Down

0 comments on commit 3835655

Please sign in to comment.