]> git.droids-corp.org - dpdk.git/blobdiff - lib/librte_vhost/virtio-net.c
vhost: fix name not null terminated
[dpdk.git] / lib / librte_vhost / virtio-net.c
index d870ad97ab7d59ca170dafe80c41c0d587c06b21..f4695afd4888de7902cec2c9d9ad76f2520ca2fa 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';
 }