diff options
author | Volker Lendecke <vl@samba.org> | 2011-08-18 14:47:09 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2011-08-22 17:11:06 +0200 |
commit | 8638b5f5d25ae0ddd1524c94a0498ee1056041f7 (patch) | |
tree | 92f85b2261080b5489310149781c0e291a5eab79 /ctdb/libctdb | |
parent | b4fd8024b5387e31723847d3843df4ba9ffe2081 (diff) | |
download | samba-8638b5f5d25ae0ddd1524c94a0498ee1056041f7.tar.gz samba-8638b5f5d25ae0ddd1524c94a0498ee1056041f7.tar.xz samba-8638b5f5d25ae0ddd1524c94a0498ee1056041f7.zip |
libctdb: Ensure 0-termination of sun_path
Rusty, please check!
Signed-off-by: Michael Adam <obnox@samba.org>
(This used to be ctdb commit 955f67a02026b157440d2ae87ead193773331e75)
Diffstat (limited to 'ctdb/libctdb')
-rw-r--r-- | ctdb/libctdb/ctdb.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ctdb/libctdb/ctdb.c b/ctdb/libctdb/ctdb.c index 141f42f63d9..8ede2a274b0 100644 --- a/ctdb/libctdb/ctdb.c +++ b/ctdb/libctdb/ctdb.c @@ -166,7 +166,7 @@ struct ctdb_connection *ctdb_connect(const char *addr, sun.sun_family = AF_UNIX; if (!addr) addr = CTDB_PATH; - strncpy(sun.sun_path, addr, sizeof(sun.sun_path)); + strncpy(sun.sun_path, addr, sizeof(sun.sun_path)-1); ctdb->fd = socket(AF_UNIX, SOCK_STREAM, 0); if (ctdb->fd < 0) goto free_fail; |