summaryrefslogtreecommitdiffstats
path: root/source3/lib
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2012-12-10 17:07:24 +0100
committerGünther Deschner <gd@samba.org>2012-12-12 15:00:02 +0100
commit07385a851f6c07c9f8ef4414d8483de7106ee486 (patch)
treeccebcd6d7e2a74a43242977494bfffe9d8e564c4 /source3/lib
parentef0a945bf8e6310acb41f90a2179e61d412a61ea (diff)
downloadsamba-07385a851f6c07c9f8ef4414d8483de7106ee486.tar.gz
samba-07385a851f6c07c9f8ef4414d8483de7106ee486.tar.xz
samba-07385a851f6c07c9f8ef4414d8483de7106ee486.zip
s3-ctdb: Make sure addr.sun_path is null terminated.
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/ctdbd_conn.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c
index 84f26e00d3..5417c67268 100644
--- a/source3/lib/ctdbd_conn.c
+++ b/source3/lib/ctdbd_conn.c
@@ -213,7 +213,7 @@ static NTSTATUS ctdbd_connect(TALLOC_CTX *mem_ctx,
ZERO_STRUCT(addr);
addr.sun_family = AF_UNIX;
- strncpy(addr.sun_path, sockname, sizeof(addr.sun_path));
+ snprintf(addr.sun_path, sizeof(addr.sun_path), "%s", sockname);
salen = sizeof(struct sockaddr_un);
if (connect(fd, (struct sockaddr *)(void *)&addr, salen) == -1) {