From: Michal Privoznik Date: Thu, 8 Jun 2017 12:58:22 +0000 (+0200) Subject: virNetDevOpenvswitchGetVhostuserIfname: Fix off by one error X-Git-Tag: v3.5.0-rc1~126 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3908d8557dc609e2262099d76c57b0bcc4b0917;p=thirdparty%2Flibvirt.git 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 --- diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitch.c index 42abcb4bbf..8f7215e062 100644 --- a/src/util/virnetdevopenvswitch.c +++ b/src/util/virnetdevopenvswitch.c @@ -444,6 +444,7 @@ virNetDevOpenvswitchGetVhostuserIfname(const char *path, goto cleanup; } + tmpIfname++; cmd = virCommandNew(OVSVSCTL); virNetDevOpenvswitchAddTimeout(cmd); virCommandAddArgList(cmd, "get", "Interface", tmpIfname, "name", NULL);