mirror of
https://github.com/samba-team/samba.git
synced 2025-01-26 10:04:02 +03:00
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)
This commit is contained in:
parent
b4fd8024b5
commit
8638b5f5d2
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user