mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-21 13:28:19 +00:00
vtysh: Fix Coverity Warning CID 1399479 (#1 of 1): Destination buffer too small (BUFFER_SIZE)
Coverity: buffer_size: You might overrun the 108 byte destination string addr.sun_path by writing the maximum 4095 bytes from path. Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
This commit is contained in:
parent
67e5d67651
commit
fa389c272f
@ -3001,7 +3001,7 @@ vtysh_connect (struct vtysh_client *vclient)
|
||||
|
||||
memset (&addr, 0, sizeof (struct sockaddr_un));
|
||||
addr.sun_family = AF_UNIX;
|
||||
strncpy (addr.sun_path, path, strlen (path));
|
||||
strlcpy (addr.sun_path, path, sizeof (addr.sun_path));
|
||||
#ifdef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN
|
||||
len = addr.sun_len = SUN_LEN(&addr);
|
||||
#else
|
||||
|
Loading…
Reference in New Issue
Block a user