diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2011-11-03 18:24:52 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2011-11-03 18:24:52 +0100 |
commit | 99d2cf02a61cef914434810877cb024b877fd93c (patch) | |
tree | cc339d1cd5924dd262268d8471256ee287def899 | |
parent | 17f396ffab3a5ad9d9984344cde6793685cf81be (diff) | |
download | libssh-99d2cf02a61cef914434810877cb024b877fd93c.tar.gz libssh-99d2cf02a61cef914434810877cb024b877fd93c.tar.xz libssh-99d2cf02a61cef914434810877cb024b877fd93c.zip |
options: Add missing argument check.
-rw-r--r-- | src/options.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/options.c b/src/options.c index 4b928dd..2c47de0 100644 --- a/src/options.c +++ b/src/options.c @@ -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) { char* src = NULL; + if (session == NULL) { return SSH_ERROR; } + + if (value == NULL) { + ssh_set_error_invalid(session); + return SSH_ERROR; + } + switch(type) { case SSH_OPTIONS_HOST: { |