summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2015-10-13 20:42:06 +0200
committerJeremy Allison <jra@samba.org>2015-10-14 05:22:28 +0200
commit74013aeee38a5c40e8c9c01d2ea46143593840b0 (patch)
tree85080ee0afc7232a9e510498650779f7328705ce /ctdb
parent593bdb97840d9fd29a2eaf04fc265c9dcc66886c (diff)
downloadsamba-74013aeee38a5c40e8c9c01d2ea46143593840b0.tar.gz
ctdb: Fix CID 1327223 Unbounded source buffer
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Oct 14 05:22:28 CEST 2015 on sn-devel-104
Diffstat (limited to 'ctdb')
-rw-r--r--ctdb/tests/src/comm_server_test.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ctdb/tests/src/comm_server_test.c b/ctdb/tests/src/comm_server_test.c
index fe0fffdf3d0..7a7656f4cd3 100644
--- a/ctdb/tests/src/comm_server_test.c
+++ b/ctdb/tests/src/comm_server_test.c
@@ -313,10 +313,13 @@ static int socket_init(char *sockpath)
{
struct sockaddr_un addr;
int fd, ret;
+ size_t len;
memset(&addr, 0, sizeof(addr));
addr.sun_family = AF_UNIX;
- strcpy(addr.sun_path, sockpath);
+
+ len = strlcpy(addr.sun_path, sockpath, sizeof(addr.sun_path));
+ assert(len < sizeof(addr.sun_path));
fd = socket(AF_UNIX, SOCK_STREAM, 0);
assert(fd != -1);