diff options
-rw-r--r-- | usr.bin/su/su.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/su/su.c b/usr.bin/su/su.c index caec3264bc0..3e4bec911f2 100644 --- a/usr.bin/su/su.c +++ b/usr.bin/su/su.c @@ -1,4 +1,4 @@ -/* $OpenBSD: su.c,v 1.21 1997/02/18 20:07:56 tholo Exp $ */ +/* $OpenBSD: su.c,v 1.22 1997/06/20 02:12:40 deraadt Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. @@ -41,7 +41,7 @@ char copyright[] = #ifndef lint /*static char sccsid[] = "from: @(#)su.c 5.26 (Berkeley) 7/6/91";*/ -static char rcsid[] = "$OpenBSD: su.c,v 1.21 1997/02/18 20:07:56 tholo Exp $"; +static char rcsid[] = "$OpenBSD: su.c,v 1.22 1997/06/20 02:12:40 deraadt Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -90,7 +90,7 @@ main(argc, argv) uid_t ruid; int asme, ch, asthem, fastlogin, prio; enum { UNSET, YES, NO } iscsh = UNSET; - char *user, *shell, *avshell, *username, *cleanenv[10], **np; + char *user, *shell, *avshell, *username, **cleanenv, **np; char shellbuf[MAXPATHLEN], avshellbuf[MAXPATHLEN]; asme = asthem = fastlogin = 0; @@ -234,7 +234,8 @@ badlogin: if (!asme) { if (asthem) { p = getenv("TERM"); - cleanenv[0] = NULL; + if ((cleanenv = calloc(1, sizeof (char *))) == NULL) + errx(1, "calloc"); environ = cleanenv; (void)setenv("PATH", _PATH_DEFPATH, 1); if (p) |