X-Git-Url: https://git.saurik.com/apple/shell_cmds.git/blobdiff_plain/9bafe2801c85cb98680afa22c908a5f5f018b3aa..1a5bac7242b5267f816c85cfd03283a4f58392b3:/su/su.c diff --git a/su/su.c b/su/su.c index aad3cad..fec3606 100644 --- a/su/su.c +++ b/su/su.c @@ -259,7 +259,8 @@ main(int argc, char *argv[]) errx(1, "permission denied (shell)."); } else if (pwd->pw_shell && *pwd->pw_shell) { - shell = pwd->pw_shell; + shell = strncpy(shellbuf, pwd->pw_shell, sizeof(shellbuf)); + shellbuf[sizeof(shellbuf) - 1] = '\0'; iscsh = UNSET; } else {