summaryrefslogtreecommitdiffstats
path: root/crypto/openssh
diff options
context:
space:
mode:
authorgreen <green@FreeBSD.org>2001-02-04 20:23:17 +0000
committergreen <green@FreeBSD.org>2001-02-04 20:23:17 +0000
commitc0460ef928465b6cc12672bb05309f2a94ab6f87 (patch)
tree8ba61168978ca36041c147685afdd656d87fc50b /crypto/openssh
parent007d3cc3ed2ff74a4b3036afcb4ceca36d9eb801 (diff)
downloadFreeBSD-src-c0460ef928465b6cc12672bb05309f2a94ab6f87.zip
FreeBSD-src-c0460ef928465b6cc12672bb05309f2a94ab6f87.tar.gz
Correctly fill in the sun_len for a sockaddr_sun.
Submitted by: Alexander Leidinger <Alexander@leidinger.net>
Diffstat (limited to 'crypto/openssh')
-rw-r--r--crypto/openssh/ssh-agent.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/openssh/ssh-agent.c b/crypto/openssh/ssh-agent.c
index 2c089c0..f115d98 100644
--- a/crypto/openssh/ssh-agent.c
+++ b/crypto/openssh/ssh-agent.c
@@ -748,7 +748,8 @@ main(int ac, char **av)
memset(&sunaddr, 0, sizeof(sunaddr));
sunaddr.sun_family = AF_UNIX;
strlcpy(sunaddr.sun_path, socket_name, sizeof(sunaddr.sun_path));
- if (bind(sock, (struct sockaddr *) & sunaddr, sizeof(sunaddr)) < 0) {
+ sunaddr.sun_len = SUN_LEN(&sunaddr) + 1;
+ if (bind(sock, (struct sockaddr *)&sunaddr, sunaddr.sun_len) < 0) {
perror("bind");
cleanup_exit(1);
}
OpenPOWER on IntegriCloud