diff options
author | Martin Winter <mwinter@opensourcerouting.org> | 2017-02-10 10:51:57 +0100 |
---|---|---|
committer | Martin Winter <mwinter@opensourcerouting.org> | 2017-02-10 10:51:57 +0100 |
commit | fa389c272f944d15f31bb21d6d1ab0c53877f30c (patch) | |
tree | ffb1e2fa5116025b3e7dc570e8ae0d7a2a9dfe87 /vtysh/vtysh.c | |
parent | ospfd: Fix Coverity Warning CID 1399480 (#1 of 1): Buffer not null terminated... (diff) | |
download | frr-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.c | 2 |
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 |