diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2012-10-08 20:43:03 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2012-10-12 08:07:01 +0200 |
commit | 5e8e21d106bc7d92a079a29fec9ce3e33079075a (patch) | |
tree | e58d37b08df433d9b2527cf3ea1b2c4e51a6646c /src/options.c | |
parent | bcc00eec9b2ebe07e13a360e7a18c9d70f84f71d (diff) | |
download | libssh-5e8e21d106bc7d92a079a29fec9ce3e33079075a.tar.gz libssh-5e8e21d106bc7d92a079a29fec9ce3e33079075a.tar.xz libssh-5e8e21d106bc7d92a079a29fec9ce3e33079075a.zip |
options: Check return code of ssh_iterator_value.
Found by Coverity.
Diffstat (limited to 'src/options.c')
-rw-r--r-- | src/options.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/options.c b/src/options.c index 844d3a5..d2580d8 100644 --- a/src/options.c +++ b/src/options.c @@ -882,7 +882,11 @@ int ssh_options_get(ssh_session session, enum ssh_options_e type, char** value) break; } case SSH_OPTIONS_IDENTITY: { - src = ssh_iterator_value(char *, ssh_list_get_iterator(session->opts.identity)); + struct ssh_iterator *it = ssh_list_get_iterator(session->opts.identity); + if (it == NULL) { + return SSH_ERROR; + } + src = ssh_iterator_value(char *, it); break; } default: |