mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 20:30:38 +09:00
Set the correct error in ssh_options_set().
Signed-off-by: Hani Benhabiles <hani@linux.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 03095f1516)
This commit is contained in:
committed by
Andreas Schneider
parent
32a106c70d
commit
f28c3099da
@@ -512,7 +512,7 @@ int ssh_options_set(ssh_session session, enum ssh_options_e type,
|
||||
}
|
||||
session->opts.username = q;
|
||||
} else if (v[0] == '\0') {
|
||||
ssh_set_error_oom(session);
|
||||
ssh_set_error_invalid(session);
|
||||
return -1;
|
||||
} else { /* username provided */
|
||||
session->opts.username = strdup(value);
|
||||
@@ -531,7 +531,7 @@ int ssh_options_set(ssh_session session, enum ssh_options_e type,
|
||||
return -1;
|
||||
}
|
||||
} else if (v[0] == '\0') {
|
||||
ssh_set_error_oom(session);
|
||||
ssh_set_error_invalid(session);
|
||||
return -1;
|
||||
} else {
|
||||
session->opts.sshdir = ssh_path_expand_tilde(v);
|
||||
|
||||
Reference in New Issue
Block a user