diff options
Diffstat (limited to 'channels.c')
-rw-r--r-- | channels.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/channels.c b/channels.c index 7cc0d281e..3fe619f48 100644 --- a/channels.c +++ b/channels.c | |||
@@ -39,7 +39,7 @@ | |||
39 | */ | 39 | */ |
40 | 40 | ||
41 | #include "includes.h" | 41 | #include "includes.h" |
42 | RCSID("$OpenBSD: channels.c,v 1.144 2001/12/06 18:02:32 stevesk Exp $"); | 42 | RCSID("$OpenBSD: channels.c,v 1.145 2001/12/06 18:09:23 stevesk Exp $"); |
43 | 43 | ||
44 | #include "ssh.h" | 44 | #include "ssh.h" |
45 | #include "ssh1.h" | 45 | #include "ssh1.h" |
@@ -2609,8 +2609,7 @@ x11_connect_display(void) | |||
2609 | * Connect to an inet socket. The DISPLAY value is supposedly | 2609 | * Connect to an inet socket. The DISPLAY value is supposedly |
2610 | * hostname:d[.s], where hostname may also be numeric IP address. | 2610 | * hostname:d[.s], where hostname may also be numeric IP address. |
2611 | */ | 2611 | */ |
2612 | strncpy(buf, display, sizeof(buf)); | 2612 | strlcpy(buf, display, sizeof(buf)); |
2613 | buf[sizeof(buf) - 1] = 0; | ||
2614 | cp = strchr(buf, ':'); | 2613 | cp = strchr(buf, ':'); |
2615 | if (!cp) { | 2614 | if (!cp) { |
2616 | error("Could not find ':' in DISPLAY: %.100s", display); | 2615 | error("Could not find ':' in DISPLAY: %.100s", display); |
@@ -2893,8 +2892,7 @@ auth_input_request_forwarding(struct passwd * pw) | |||
2893 | /* Bind it to the name. */ | 2892 | /* Bind it to the name. */ |
2894 | memset(&sunaddr, 0, sizeof(sunaddr)); | 2893 | memset(&sunaddr, 0, sizeof(sunaddr)); |
2895 | sunaddr.sun_family = AF_UNIX; | 2894 | sunaddr.sun_family = AF_UNIX; |
2896 | strncpy(sunaddr.sun_path, auth_sock_name, | 2895 | strlcpy(sunaddr.sun_path, auth_sock_name, sizeof(sunaddr.sun_path)); |
2897 | sizeof(sunaddr.sun_path)); | ||
2898 | 2896 | ||
2899 | if (bind(sock, (struct sockaddr *) & sunaddr, sizeof(sunaddr)) < 0) | 2897 | if (bind(sock, (struct sockaddr *) & sunaddr, sizeof(sunaddr)) < 0) |
2900 | packet_disconnect("bind: %.100s", strerror(errno)); | 2898 | packet_disconnect("bind: %.100s", strerror(errno)); |