mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-12 14:01:11 +00:00
nhrpd: Use strlcpy not unsafe strncpy
Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
This commit is contained in:
parent
0f8595a9f4
commit
ca317495b8
@ -32,6 +32,11 @@
|
|||||||
#include "os.h"
|
#include "os.h"
|
||||||
#include "netlink.h"
|
#include "netlink.h"
|
||||||
|
|
||||||
|
#ifndef HAVE_STRLCPY
|
||||||
|
size_t strlcpy(char *__restrict dest,
|
||||||
|
const char *__restrict src, size_t destsize);
|
||||||
|
#endif
|
||||||
|
|
||||||
static int nhrp_socket_fd = -1;
|
static int nhrp_socket_fd = -1;
|
||||||
|
|
||||||
int os_socket(void)
|
int os_socket(void)
|
||||||
@ -112,7 +117,7 @@ static int linux_configure_arp(const char *iface, int on)
|
|||||||
{
|
{
|
||||||
struct ifreq ifr;
|
struct ifreq ifr;
|
||||||
|
|
||||||
strncpy(ifr.ifr_name, iface, IFNAMSIZ - 1);
|
strlcpy(ifr.ifr_name, iface, IFNAMSIZ);
|
||||||
if (ioctl(nhrp_socket_fd, SIOCGIFFLAGS, &ifr))
|
if (ioctl(nhrp_socket_fd, SIOCGIFFLAGS, &ifr))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user