vhost: fix name not null terminated
[dpdk.git] / lib / librte_vhost / virtio-net.c
index d870ad9..f4695af 100644 (file)
@@ -320,6 +320,7 @@ vhost_set_ifname(struct vhost_device_ctx ctx,
                sizeof(dev->ifname) : if_len;
 
        strncpy(dev->ifname, if_name, len);
+       dev->ifname[sizeof(dev->ifname) - 1] = '\0';
 }