Skip to content

Commit d339113

Browse files
committed
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 <[email protected]> Fixes: 740e4d7 Reviewed-by: Martin Kletzander <[email protected]>
1 parent 24b2f96 commit d339113

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/virt-login-shell-helper.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ static int virLoginShellGetShellArgv(virConfPtr conf,
104104
(*shargv)[0] = g_strdup("/bin/sh");
105105
*shargvlen = 1;
106106
} else {
107-
*shargvlen = virStringListLength((const char *const *)shargv);
107+
*shargvlen = virStringListLength((const char *const *)*shargv);
108108
}
109109
return 0;
110110
}

0 commit comments

Comments
 (0)