summaryrefslogtreecommitdiff
path: root/security/ssh2/files/patch-ad
blob: 5eeb34a2e22e5345ee1df5d669b07656dd4a1e33 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
*** sshconnect.c.orig	Wed Oct 16 10:10:26 1996
--- sshconnect.c	Wed Oct 16 10:23:49 1996
***************
*** 797,802 ****
--- 797,803 ----
    char buf[256], remote_version[256]; /* must be same size! */
    int remote_major, remote_minor, i;
    int my_major, my_minor;
+   int len;
    int connection_in = packet_get_connection_in();
    int connection_out = packet_get_connection_out();
  
***************
*** 803,809 ****
    /* Read other side\'s version identification. */
    for (i = 0; i < sizeof(buf) - 1; i++)
      {
!       if (read(connection_in, &buf[i], 1) != 1)
  	fatal("read: %.100s", strerror(errno));
        if (buf[i] == '\r')
  	{
--- 804,813 ----
    /* Read other side\'s version identification. */
    for (i = 0; i < sizeof(buf) - 1; i++)
      {
!       len = read(connection_in, &buf[i], 1);
!       if (len == 0)
! 	fatal("Connection closed by foreign host.");
!       else if (len < 0)
  	fatal("read: %.100s", strerror(errno));
        if (buf[i] == '\r')
  	{