1
0
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:
Andreas Schneider
2011-11-03 18:24:52 +01:00
parent 17f396ffab
commit 99d2cf02a6

View File

@@ -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: {