]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virNetDevOpenvswitchGetVhostuserIfname: Fix off by one error
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 8 Jun 2017 12:58:22 +0000 (14:58 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 8 Jun 2017 13:02:23 +0000 (15:02 +0200)
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>
src/util/virnetdevopenvswitch.c

index 42abcb4bbff6c0a1b07d3469e1ae6c81b55177b4..8f7215e0624bae3f307fd3b3bbf475b31bb74a3b 100644 (file)
@@ -444,6 +444,7 @@ virNetDevOpenvswitchGetVhostuserIfname(const char *path,
         goto cleanup;
     }
 
+    tmpIfname++;
     cmd = virCommandNew(OVSVSCTL);
     virNetDevOpenvswitchAddTimeout(cmd);
     virCommandAddArgList(cmd, "get", "Interface", tmpIfname, "name", NULL);