From 3da5fcbb5662c682c4bccbdd4401b24b480b2fac Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Fri, 23 Nov 2018 14:08:50 +0100 Subject: [PATCH] options: Do not crash when setting knownhosts to NULL (T108) Signed-off-by: Jakub Jelen Reviewed-by: Andreas Schneider --- src/options.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/options.c b/src/options.c index 4ffa99bb..81d02c91 100644 --- a/src/options.c +++ b/src/options.c @@ -611,12 +611,7 @@ int ssh_options_set(ssh_session session, enum ssh_options_e type, v = value; SAFE_FREE(session->opts.knownhosts); if (v == NULL) { - session->opts.knownhosts = ssh_path_expand_escape(session, - "%d/known_hosts"); - if (session->opts.knownhosts == NULL) { - ssh_set_error_oom(session); - return -1; - } + /* The default value will be set by the ssh_options_apply() */ } else if (v[0] == '\0') { ssh_set_error_invalid(session); return -1;