mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-06-11 12:56:21 +09:00
fix: initialize known_hosts output entry
ssh_session_get_known_hosts_entry() could return SSH_KNOWN_HOSTS_OK without initializing *pentry, leaving callers with an undefined output pointer. Initialize *pentry to NULL at function entry so every return path leaves the output in a defined state. Signed-off-by: Nuhiat-Arefin <nuhiatarefin@gmail.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> Merge-Request: <https://gitlab.com/libssh/libssh-mirror/-/merge_requests/814>
This commit is contained in:
committed by
Jakub Jelen
parent
854e9823f5
commit
6cd0e6e52a
@@ -1182,6 +1182,10 @@ ssh_session_get_known_hosts_entry(ssh_session session,
|
||||
{
|
||||
enum ssh_known_hosts_e old_rv, rv = SSH_KNOWN_HOSTS_UNKNOWN;
|
||||
|
||||
if (pentry != NULL) {
|
||||
*pentry = NULL;
|
||||
}
|
||||
|
||||
if (session->opts.knownhosts == NULL) {
|
||||
if (ssh_options_apply(session) < 0) {
|
||||
ssh_set_error(session,
|
||||
|
||||
Reference in New Issue
Block a user