mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06: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");
|
(*shargv)[0] = g_strdup("/bin/sh");
|
||||||
*shargvlen = 1;
|
*shargvlen = 1;
|
||||||
} else {
|
} else {
|
||||||
*shargvlen = virStringListLength((const char *const *)shargv);
|
*shargvlen = virStringListLength((const char *const *)*shargv);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user