diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2002-03-05 01:54:52 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2002-03-05 01:54:52 +0000 |
commit | 6b28c35a04069c5b19e541c86e767da5841422d0 (patch) | |
tree | 1f7ea997412ee0719d00a76525b8d5b072358f1a /ssh-keyscan.c | |
parent | 05764b9286940cacd16c3fc585ea082c2ace5ec2 (diff) |
- stevesk@cvs.openbsd.org 2002/03/04 18:30:23
[ssh-keyscan.c]
handle connection close during read of protocol version string.
fixes erroneous "bad greeting". ok markus@
Diffstat (limited to 'ssh-keyscan.c')
-rw-r--r-- | ssh-keyscan.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ssh-keyscan.c b/ssh-keyscan.c index 88f10ebec..824264c32 100644 --- a/ssh-keyscan.c +++ b/ssh-keyscan.c | |||
@@ -7,7 +7,7 @@ | |||
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include "includes.h" | 9 | #include "includes.h" |
10 | RCSID("$OpenBSD: ssh-keyscan.c,v 1.34 2002/02/22 12:20:34 markus Exp $"); | 10 | RCSID("$OpenBSD: ssh-keyscan.c,v 1.35 2002/03/04 18:30:23 stevesk Exp $"); |
11 | 11 | ||
12 | #if defined(HAVE_SYS_QUEUE_H) && !defined(HAVE_BOGUS_SYS_QUEUE_H) | 12 | #if defined(HAVE_SYS_QUEUE_H) && !defined(HAVE_BOGUS_SYS_QUEUE_H) |
13 | #include <sys/queue.h> | 13 | #include <sys/queue.h> |
@@ -511,6 +511,11 @@ congreet(int s) | |||
511 | conrecycle(s); | 511 | conrecycle(s); |
512 | return; | 512 | return; |
513 | } | 513 | } |
514 | if (n == 0) { | ||
515 | error("%s: Connection closed by remote host", c->c_name); | ||
516 | conrecycle(s); | ||
517 | return; | ||
518 | } | ||
514 | if (*cp != '\n' && *cp != '\r') { | 519 | if (*cp != '\n' && *cp != '\r') { |
515 | error("%s: bad greeting", c->c_name); | 520 | error("%s: bad greeting", c->c_name); |
516 | confree(s); | 521 | confree(s); |