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