1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-23 21:34:54 +03:00

virNetDevOpenvswitchGetVhostuserIfname: Fix off by one error

https://bugzilla.redhat.com/show_bug.cgi?id=1459091

We try to get the last element of the passed path by calling
strrch(path, '/'). However, the pointer that strrchr() returns
points at the slash, We want string that starts right after that.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Michal Privoznik 2017-06-08 14:58:22 +02:00
parent 2a13a0a103
commit f3908d8557

View File

@ -444,6 +444,7 @@ virNetDevOpenvswitchGetVhostuserIfname(const char *path,
goto cleanup;
}
tmpIfname++;
cmd = virCommandNew(OVSVSCTL);
virNetDevOpenvswitchAddTimeout(cmd);
virCommandAddArgList(cmd, "get", "Interface", tmpIfname, "name", NULL);