From bd5790f9b213013a16e40a6fe79cbd11ddf567e4 Mon Sep 17 00:00:00 2001 From: Jan Cholasta Date: Sep 20 2012 08:17:57 +0000 Subject: SSH: Fix possible infinite loop when updating known_hosts --- diff --git a/src/responder/ssh/sshsrv_cmd.c b/src/responder/ssh/sshsrv_cmd.c index 2497eb4..82a1f90 100644 --- a/src/responder/ssh/sshsrv_cmd.c +++ b/src/responder/ssh/sshsrv_cmd.c @@ -592,7 +592,7 @@ ssh_host_pubkeys_update_known_hosts(struct ssh_cmd_ctx *cmd_ctx) goto done; } - while (dom) { + for (; dom; dom = dom->next) { sysdb = dom->sysdb; if (sysdb == NULL) { DEBUG(SSSDBG_FATAL_FAILURE, @@ -641,8 +641,6 @@ ssh_host_pubkeys_update_known_hosts(struct ssh_cmd_ctx *cmd_ctx) } talloc_free(hosts); - - dom = dom->next; } ret = fchmod(fd, 0644);