=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/su/su.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- src/usr.bin/su/su.c 1997/02/18 20:07:56 1.21 +++ src/usr.bin/su/su.c 1997/06/20 02:12:40 1.22 @@ -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 @@ #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 @@ -90,7 +90,7 @@ 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 @@ 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)