mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 09:54:25 +09:00
knownhosts: Fix and infinite loop when iterating known host entries
Fixes #145 Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
This commit is contained in:
@@ -591,6 +591,8 @@ char *ssh_known_hosts_get_algorithms_names(ssh_session session)
|
|||||||
entry = ssh_iterator_value(struct ssh_knownhosts_entry *, it);
|
entry = ssh_iterator_value(struct ssh_knownhosts_entry *, it);
|
||||||
algo = ssh_known_host_sigs_from_hostkey_type(entry->publickey->type);
|
algo = ssh_known_host_sigs_from_hostkey_type(entry->publickey->type);
|
||||||
if (algo == NULL) {
|
if (algo == NULL) {
|
||||||
|
ssh_knownhosts_entry_free(entry);
|
||||||
|
ssh_list_remove(entry_list, it);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user