X-Git-Url: https://gerrit.fd.io/r/gitweb?p=deb_dpdk.git;a=blobdiff_plain;f=drivers%2Fnet%2Fvirtio%2Fvirtio_user%2Fvhost_kernel_tap.c;h=689a5cff75f6c494cb5a57103254bd46add9baaa;hp=f585de8c33a91d8f732dd85b81bc3dc87375b623;hb=055c52583a2794da8ba1e85a48cce3832372b12f;hpb=f239aed5e674965691846e8ce3f187dd47523689 diff --git a/drivers/net/virtio/virtio_user/vhost_kernel_tap.c b/drivers/net/virtio/virtio_user/vhost_kernel_tap.c index f585de8c..689a5cff 100644 --- a/drivers/net/virtio/virtio_user/vhost_kernel_tap.c +++ b/drivers/net/virtio/virtio_user/vhost_kernel_tap.c @@ -95,9 +95,9 @@ vhost_kernel_open_tap(char **p_ifname, int hdr_size, int req_mq) ifr.ifr_flags |= IFF_MULTI_QUEUE; if (*p_ifname) - strncpy(ifr.ifr_name, *p_ifname, IFNAMSIZ); + strncpy(ifr.ifr_name, *p_ifname, IFNAMSIZ - 1); else - strncpy(ifr.ifr_name, "tap%d", IFNAMSIZ); + strncpy(ifr.ifr_name, "tap%d", IFNAMSIZ - 1); if (ioctl(tapfd, TUNSETIFF, (void *)&ifr) == -1) { PMD_DRV_LOG(ERR, "TUNSETIFF failed: %s", strerror(errno)); goto error;