mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-26 15:45:28 +00: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:
parent
2a13a0a103
commit
f3908d8557
@ -444,6 +444,7 @@ virNetDevOpenvswitchGetVhostuserIfname(const char *path,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tmpIfname++;
|
||||||
cmd = virCommandNew(OVSVSCTL);
|
cmd = virCommandNew(OVSVSCTL);
|
||||||
virNetDevOpenvswitchAddTimeout(cmd);
|
virNetDevOpenvswitchAddTimeout(cmd);
|
||||||
virCommandAddArgList(cmd, "get", "Interface", tmpIfname, "name", NULL);
|
virCommandAddArgList(cmd, "get", "Interface", tmpIfname, "name", NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user