mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-07 04:07:17 +00:00
virt-login-shell: correctly calculate string length
virLoginShellGetShellArgv was not dereferencing the pointer to the string list containing the shell parameters from the config file, thus setting some random number as shargvlen. Signed-off-by: Ján Tomko <jtomko@redhat.com> Fixes: 740e4d705284ba0598258291c2656f50075486f0 Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
24b2f96a41
commit
d339113ab0
@ -104,7 +104,7 @@ static int virLoginShellGetShellArgv(virConfPtr conf,
|
||||
(*shargv)[0] = g_strdup("/bin/sh");
|
||||
*shargvlen = 1;
|
||||
} else {
|
||||
*shargvlen = virStringListLength((const char *const *)shargv);
|
||||
*shargvlen = virStringListLength((const char *const *)*shargv);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user