vhost: fix name not null terminated
authorDaniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Tue, 10 May 2016 16:11:18 +0000 (18:11 +0200)
committerYuanhan Liu <yuanhan.liu@linux.intel.com>
Tue, 10 May 2016 18:25:30 +0000 (20:25 +0200)
commita5e20775a7588042c64f3919787b689f1c861369
tree23f747256263db126e07f15a33eb539a4566d311
parent56fe86f8dcafb9e48390742467d39c78c1a432cf
vhost: fix name not null terminated

Fix issue reported by Coverity.
Coverity ID 124556

If the buffer is treated as a null terminated string in later operations,
a buffer overflow or over-read may occur.

In vhost_set_ifname: The string buffer may not have a null terminator if
the source string's length is equal to the buffer size

Fixes: 54292e9520e0 ("vhost: support ifname for vhost-user")

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
lib/librte_vhost/virtio-net.c