summaryrefslogtreecommitdiffstats
path: root/ssh-keyscan.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssh-keyscan.c')
-rw-r--r--ssh-keyscan.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ssh-keyscan.c b/ssh-keyscan.c
index 88f10ebe..824264c3 100644
--- a/ssh-keyscan.c
+++ b/ssh-keyscan.c
@@ -7,7 +7,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: ssh-keyscan.c,v 1.34 2002/02/22 12:20:34 markus Exp $");
+RCSID("$OpenBSD: ssh-keyscan.c,v 1.35 2002/03/04 18:30:23 stevesk Exp $");
#if defined(HAVE_SYS_QUEUE_H) && !defined(HAVE_BOGUS_SYS_QUEUE_H)
#include <sys/queue.h>
@@ -511,6 +511,11 @@ congreet(int s)
conrecycle(s);
return;
}
+ if (n == 0) {
+ error("%s: Connection closed by remote host", c->c_name);
+ conrecycle(s);
+ return;
+ }
if (*cp != '\n' && *cp != '\r') {
error("%s: bad greeting", c->c_name);
confree(s);