mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-08-13 04:42:23 +03:00
options: Add missing argument check.
This commit is contained in:
@@ -843,9 +843,16 @@ int ssh_options_get_port(ssh_session session, unsigned int* port_target) {
|
|||||||
int ssh_options_get(ssh_session session, enum ssh_options_e type, char** value)
|
int ssh_options_get(ssh_session session, enum ssh_options_e type, char** value)
|
||||||
{
|
{
|
||||||
char* src = NULL;
|
char* src = NULL;
|
||||||
|
|
||||||
if (session == NULL) {
|
if (session == NULL) {
|
||||||
return SSH_ERROR;
|
return SSH_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (value == NULL) {
|
||||||
|
ssh_set_error_invalid(session);
|
||||||
|
return SSH_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
switch(type)
|
switch(type)
|
||||||
{
|
{
|
||||||
case SSH_OPTIONS_HOST: {
|
case SSH_OPTIONS_HOST: {
|
||||||
|
Reference in New Issue
Block a user