mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-30 13:01:23 +03:00
SSH-01-006: Add missing NULL check in server_set_kex()
Fixes T193 Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
@@ -175,6 +175,13 @@ int server_set_kex(ssh_session session)
|
||||
wanted = ssh_kex_get_default_methods(i);
|
||||
}
|
||||
}
|
||||
if (wanted == NULL) {
|
||||
for (j = 0; j < i; j++) {
|
||||
SAFE_FREE(server->methods[j]);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
server->methods[i] = strdup(wanted);
|
||||
if (server->methods[i] == NULL) {
|
||||
for (j = 0; j < i; j++) {
|
||||
|
||||
Reference in New Issue
Block a user