summaryrefslogtreecommitdiffstats
path: root/vtysh/vtysh.c
diff options
context:
space:
mode:
authorMartin Winter <mwinter@opensourcerouting.org>2017-02-10 10:51:57 +0100
committerMartin Winter <mwinter@opensourcerouting.org>2017-02-10 10:51:57 +0100
commitfa389c272f944d15f31bb21d6d1ab0c53877f30c (patch)
treeffb1e2fa5116025b3e7dc570e8ae0d7a2a9dfe87 /vtysh/vtysh.c
parentospfd: Fix Coverity Warning CID 1399480 (#1 of 1): Buffer not null terminated... (diff)
downloadfrr-fa389c272f944d15f31bb21d6d1ab0c53877f30c.tar.xz
frr-fa389c272f944d15f31bb21d6d1ab0c53877f30c.zip
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>
Diffstat (limited to '')
-rw-r--r--vtysh/vtysh.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 7546b4ddb..1b0dd8cd2 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -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