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:
Ján Tomko 2020-08-02 14:58:38 +02:00
parent 24b2f96a41
commit d339113ab0

View File

@ -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;
}