kex.c: make sure mlist is not set to NULL
... if the currently unsupported LANG methods are called. Reported by Coverity CID 89834.
This commit is contained in:
parent
dc199ed03a
commit
3835655f09
@ -1866,7 +1866,7 @@ libssh2_session_method_pref(LIBSSH2_SESSION * session, int method_type,
|
|||||||
}
|
}
|
||||||
memcpy(s, prefs, prefs_len + 1);
|
memcpy(s, prefs, prefs_len + 1);
|
||||||
|
|
||||||
while (s && *s) {
|
while (s && *s && mlist) {
|
||||||
char *p = strchr(s, ',');
|
char *p = strchr(s, ',');
|
||||||
int method_len = p ? (p - s) : (int) strlen(s);
|
int method_len = p ? (p - s) : (int) strlen(s);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user