mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +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: 740e4d7052
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…
Reference in New Issue
Block a user