[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] virNetDevOpenvswitchGetVhostuserIfname: Fix off by one error


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>

Pushed as trivial.

 src/util/virnetdevopenvswitch.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitch.c
index 42abcb4bb..8f7215e06 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);
     virCommandAddArgList(cmd, "get", "Interface", tmpIfname, "name", NULL);

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]