summaryrefslogtreecommitdiff
path: root/sshconnect.c
diff options
context:
space:
mode:
Diffstat (limited to 'sshconnect.c')
-rw-r--r--sshconnect.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sshconnect.c b/sshconnect.c
index c76572662..e26efa4dc 100644
--- a/sshconnect.c
+++ b/sshconnect.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshconnect.c,v 1.184 2006/06/08 14:45:49 markus Exp $ */ 1/* $OpenBSD: sshconnect.c,v 1.185 2006/06/14 10:50:42 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -385,10 +385,10 @@ ssh_exchange_identification(void)
385 int connection_in = packet_get_connection_in(); 385 int connection_in = packet_get_connection_in();
386 int connection_out = packet_get_connection_out(); 386 int connection_out = packet_get_connection_out();
387 int minor1 = PROTOCOL_MINOR_1; 387 int minor1 = PROTOCOL_MINOR_1;
388 u_int i; 388 u_int i, n;
389 389
390 /* Read other side's version identification. */ 390 /* Read other side's version identification. */
391 for (;;) { 391 for (n = 0;;) {
392 for (i = 0; i < sizeof(buf) - 1; i++) { 392 for (i = 0; i < sizeof(buf) - 1; i++) {
393 size_t len = atomicio(read, connection_in, &buf[i], 1); 393 size_t len = atomicio(read, connection_in, &buf[i], 1);
394 394
@@ -405,6 +405,8 @@ ssh_exchange_identification(void)
405 buf[i + 1] = 0; 405 buf[i + 1] = 0;
406 break; 406 break;
407 } 407 }
408 if (++n > 65536)
409 fatal("ssh_exchange_identification: No banner received");
408 } 410 }
409 buf[sizeof(buf) - 1] = 0; 411 buf[sizeof(buf) - 1] = 0;
410 if (strncmp(buf, "SSH-", 4) == 0) 412 if (strncmp(buf, "SSH-", 4) == 0)