From 4b298ca7707c4ec91b870950eecd4f759fb225d9 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Wed, 27 Jun 2018 13:48:04 +0200 Subject: [PATCH] kex: Check allocation result Signed-off-by: Jakub Jelen Reviewed-by: Andreas Schneider --- src/kex.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/kex.c b/src/kex.c index 6f678c46..3fa5cc6c 100644 --- a/src/kex.c +++ b/src/kex.c @@ -662,6 +662,10 @@ int ssh_set_client_kex(ssh_session session){ if (wanted == NULL) wanted = default_methods[i]; client->methods[i] = strdup(wanted); + if (client->methods[i] == NULL) { + ssh_set_error_oom(session); + return SSH_ERROR; + } } return SSH_OK;