summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2016-07-27 16:22:36 +1000
committerStefan Metzmacher <metze@samba.org>2016-08-10 11:24:36 +0200
commit13301d8ec964b8154f33dfc67a83db010dcd2b15 (patch)
treed87b3977db4ade4641eb4d69f28eb9f935990097
parent38d8bcf89f2796de3dc7318e19fd373fa5e5bb3f (diff)
downloadsamba-13301d8ec964b8154f33dfc67a83db010dcd2b15.tar.gz
ctdb-common: Fix CID 1125553 Buffer not null terminated (BUFFER_SIZE_WARNING)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12110 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit 763f9c13f2998a8858e8a3ec013d166a3d429835)
-rw-r--r--ctdb/common/system_linux.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ctdb/common/system_linux.c b/ctdb/common/system_linux.c
index ef78df874fa..8bb18f836f0 100644
--- a/ctdb/common/system_linux.c
+++ b/ctdb/common/system_linux.c
@@ -202,7 +202,7 @@ int ctdb_sys_send_arp(const ctdb_sock_addr *addr, const char *iface)
}
DEBUG(DEBUG_DEBUG, (__location__ " Created SOCKET FD:%d for sending arp\n", s));
- strncpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name));
+ strlcpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name));
if (ioctl(s, SIOCGIFINDEX, &ifr) < 0) {
DEBUG(DEBUG_CRIT,(__location__ " interface '%s' not found\n", iface));
close(s);