summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Fiddaman <omnios@citrus-it.co.uk>2021-08-12 16:35:50 +0000
committerAndy Fiddaman <omnios@citrus-it.co.uk>2021-08-13 09:20:13 +0000
commitd209bf0d7c080e4110469ed3a2c94e2382091f6c (patch)
tree921be9568f47fdb58706b110a11fded131220693
parentbdc24928e6e072b3224ad4bcd1769e68dc91f970 (diff)
downloadillumos-joyent-d209bf0d7c080e4110469ed3a2c94e2382091f6c.tar.gz
14021 stack overflow in smbd:smbd_dc_check
Reviewed by: Mike Zeller <mike.zeller@joyent.com> Reviewed by: Toomas Soome <tsoome@me.com> Approved by: Robert Mustacchi <rm@fingolfin.org>
-rw-r--r--usr/src/cmd/smbsrv/smbd/smbd_join.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr/src/cmd/smbsrv/smbd/smbd_join.c b/usr/src/cmd/smbsrv/smbd/smbd_join.c
index cfff2b11f6..1e844c6473 100644
--- a/usr/src/cmd/smbsrv/smbd/smbd_join.c
+++ b/usr/src/cmd/smbsrv/smbd/smbd_join.c
@@ -187,7 +187,7 @@ smbd_dc_monitor(void *arg)
static int
smbd_dc_check(smb_domainex_t *di)
{
- struct sockaddr sa;
+ struct sockaddr_storage sa;
int salen = 0;
int sock = -1;
int tmo = 5 * 1000; /* 5 sec. */
@@ -223,7 +223,7 @@ smbd_dc_check(smb_domainex_t *di)
(void) setsockopt(sock, IPPROTO_TCP,
TCP_CONN_ABORT_THRESHOLD, &tmo, sizeof (tmo));
- rc = connect(sock, &sa, salen);
+ rc = connect(sock, (const struct sockaddr *)&sa, salen);
if (rc < 0)
rc = errno;