Skip to content

Commit

Permalink
vtysh: Fix Coverity Warning CID 1399479 (#1 of 1): Destination buffer…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
mwinter-osr committed Feb 7, 2017
1 parent d8d8d50 commit f924754
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vtysh/vtysh.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, strlen (addr.sun_path));
#ifdef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN
len = addr.sun_len = SUN_LEN(&addr);
#else
Expand Down

0 comments on commit f924754

Please sign in to comment.