]> git.saurik.com Git - apple/shell_cmds.git/blobdiff - su/su.c
shell_cmds-81.tar.gz
[apple/shell_cmds.git] / su / su.c
diff --git a/su/su.c b/su/su.c
index aad3cad292e484cc7b350ba4e860b392bf0ed298..fec3606d728bc841f136ffc3e0027a5308390495 100644 (file)
--- 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 {