summaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/devices/virtio/vhost_user.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/vnet/devices/virtio/vhost_user.c b/src/vnet/devices/virtio/vhost_user.c
index d8c79ea17aa..f7cecef4d19 100644
--- a/src/vnet/devices/virtio/vhost_user.c
+++ b/src/vnet/devices/virtio/vhost_user.c
@@ -1230,6 +1230,7 @@ vhost_user_process (vlib_main_t * vm,
/* try to connect */
strncpy (sun.sun_path, (char *) vui->sock_filename,
sizeof (sun.sun_path) - 1);
+ sun.sun_path[sizeof (sun.sun_path) - 1] = 0;
/* Avoid hanging VPP if the other end does not accept */
if (fcntl(sockfd, F_SETFL, O_NONBLOCK) < 0)