diff options
author | Volker Lendecke <vl@samba.org> | 2015-10-13 20:42:06 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2015-10-14 05:22:28 +0200 |
commit | 74013aeee38a5c40e8c9c01d2ea46143593840b0 (patch) | |
tree | 85080ee0afc7232a9e510498650779f7328705ce /ctdb | |
parent | 593bdb97840d9fd29a2eaf04fc265c9dcc66886c (diff) | |
download | samba-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.c | 5 |
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); |