summaryrefslogtreecommitdiff
path: root/mux.c
diff options
context:
space:
mode:
Diffstat (limited to 'mux.c')
-rw-r--r--mux.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/mux.c b/mux.c
index 265c5f12b..2d6639c5c 100644
--- a/mux.c
+++ b/mux.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: mux.c,v 1.63 2016/10/19 23:21:56 dtucker Exp $ */ 1/* $OpenBSD: mux.c,v 1.64 2017/01/21 11:32:04 guenther Exp $ */
2/* 2/*
3 * Copyright (c) 2002-2008 Damien Miller <djm@openbsd.org> 3 * Copyright (c) 2002-2008 Damien Miller <djm@openbsd.org>
4 * 4 *
@@ -2161,7 +2161,6 @@ int
2161muxclient(const char *path) 2161muxclient(const char *path)
2162{ 2162{
2163 struct sockaddr_un addr; 2163 struct sockaddr_un addr;
2164 socklen_t sun_len;
2165 int sock; 2164 int sock;
2166 u_int pid; 2165 u_int pid;
2167 2166
@@ -2185,8 +2184,6 @@ muxclient(const char *path)
2185 2184
2186 memset(&addr, '\0', sizeof(addr)); 2185 memset(&addr, '\0', sizeof(addr));
2187 addr.sun_family = AF_UNIX; 2186 addr.sun_family = AF_UNIX;
2188 sun_len = offsetof(struct sockaddr_un, sun_path) +
2189 strlen(path) + 1;
2190 2187
2191 if (strlcpy(addr.sun_path, path, 2188 if (strlcpy(addr.sun_path, path,
2192 sizeof(addr.sun_path)) >= sizeof(addr.sun_path)) 2189 sizeof(addr.sun_path)) >= sizeof(addr.sun_path))
@@ -2196,7 +2193,7 @@ muxclient(const char *path)
2196 if ((sock = socket(PF_UNIX, SOCK_STREAM, 0)) < 0) 2193 if ((sock = socket(PF_UNIX, SOCK_STREAM, 0)) < 0)
2197 fatal("%s socket(): %s", __func__, strerror(errno)); 2194 fatal("%s socket(): %s", __func__, strerror(errno));
2198 2195
2199 if (connect(sock, (struct sockaddr *)&addr, sun_len) == -1) { 2196 if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) == -1) {
2200 switch (muxclient_command) { 2197 switch (muxclient_command) {
2201 case SSHMUX_COMMAND_OPEN: 2198 case SSHMUX_COMMAND_OPEN:
2202 case SSHMUX_COMMAND_STDIO_FWD: 2199 case SSHMUX_COMMAND_STDIO_FWD: