From: Martin Schwenke Date: Wed, 27 Jul 2016 06:22:36 +0000 (+1000) Subject: ctdb-common: Fix CID 1125553 Buffer not null terminated (BUFFER_SIZE_WARNING) X-Git-Tag: samba-4.3.12~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5d0277072bcab696c7e583d5bb6d4e4bcfd9ee0;p=thirdparty%2Fsamba.git 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 Reviewed-by: Amitay Isaacs (cherry picked from commit 763f9c13f2998a8858e8a3ec013d166a3d429835) --- diff --git a/ctdb/common/system_linux.c b/ctdb/common/system_linux.c index 9872070af5a..f871a478e8f 100644 --- a/ctdb/common/system_linux.c +++ b/ctdb/common/system_linux.c @@ -194,7 +194,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);