aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2012-10-08 20:43:03 +0200
committerAndreas Schneider <asn@cryptomilk.org>2012-10-12 08:07:01 +0200
commit5e8e21d106bc7d92a079a29fec9ce3e33079075a (patch)
treee58d37b08df433d9b2527cf3ea1b2c4e51a6646c /src
parentbcc00eec9b2ebe07e13a360e7a18c9d70f84f71d (diff)
downloadlibssh-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')
-rw-r--r--src/options.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/options.c b/src/options.c
index 844d3a56..d2580d8d 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: