1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-27 13:21:11 +03:00

options: Check return code of ssh_iterator_value.

Found by Coverity.
This commit is contained in:
Andreas Schneider
2012-10-08 20:43:03 +02:00
parent bcc00eec9b
commit 5e8e21d106

View File

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