diff options
| author | Martin Winter <mwinter@opensourcerouting.org> | 2017-02-10 16:51:57 +0700 |
|---|---|---|
| committer | Martin Winter <mwinter@opensourcerouting.org> | 2017-02-10 16:51:57 +0700 |
| commit | fa389c272f944d15f31bb21d6d1ab0c53877f30c (patch) | |
| tree | ffb1e2fa5116025b3e7dc570e8ae0d7a2a9dfe87 /vtysh | |
| parent | 67e5d67651bd94b52e33442308158a415e43f39f (diff) | |
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 'vtysh')
| -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 7546b4ddb0..1b0dd8cd29 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 |
