mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-29 01:03:57 +03:00
options: Do not crash when setting knownhosts to NULL (T108)
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Andreas Schneider
parent
9d8c943c68
commit
3da5fcbb56
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user