git.samba.org
/
ctdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fa6564c
)
libctdb: Ensure 0-termination of sun_path
author
Volker Lendecke
<vl@samba.org>
Thu, 18 Aug 2011 12:47:09 +0000
(14:47 +0200)
committer
Michael Adam
<obnox@samba.org>
Mon, 22 Aug 2011 15:11:06 +0000
(17:11 +0200)
Rusty, please check!
Signed-off-by: Michael Adam <obnox@samba.org>
libctdb/ctdb.c
patch
|
blob
|
history
diff --git
a/libctdb/ctdb.c
b/libctdb/ctdb.c
index 141f42f63d9cd747324d84f81ca1f56b38858a54..8ede2a274b06667969beced3be7a2304c631b3e6 100644
(file)
--- a/
libctdb/ctdb.c
+++ b/
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;