]> git.puffer.fish Git - matthieu/frr.git/commitdiff
Revert "nhrpd: strncpy -> strlcpy"
authorQuentin Young <qlyoung@cumulusnetworks.com>
Tue, 5 Mar 2019 19:29:49 +0000 (19:29 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Tue, 5 Mar 2019 19:29:49 +0000 (19:29 +0000)
This reverts commit eb266ecb847b70bcf9901da5ed59a39d3e07fd8f.

nhrpd/linux.c
nhrpd/vici.c

index bb5ce0fec6b2c41e65a087a8c020e1ecbf33b0c2..85e941e7bacd1d63fed3300fe7e708df39c4f420 100644 (file)
@@ -110,7 +110,7 @@ static int linux_configure_arp(const char *iface, int on)
 {
        struct ifreq ifr;
 
-       strlcpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name));
+       strncpy(ifr.ifr_name, iface, IFNAMSIZ - 1);
        if (ioctl(nhrp_socket_fd, SIOCGIFFLAGS, &ifr))
                return -1;
 
index fab99588c86cb10a08109f9d20172f46bbd1973c..3de4609a2bc435966bbb18d6881b370db08b14d7 100644 (file)
@@ -550,7 +550,7 @@ int sock_open_unix(const char *path)
 
        memset(&addr, 0, sizeof(struct sockaddr_un));
        addr.sun_family = AF_UNIX;
-       strlcpy(addr.sun_path, path, sizeof(addr.sun_path));
+       strncpy(addr.sun_path, path, sizeof(addr.sun_path) - 1);
 
        ret = connect(fd, (struct sockaddr *)&addr,
                      sizeof(addr.sun_family) + strlen(addr.sun_path));