summaryrefslogtreecommitdiffstats
path: root/bin/csh
diff options
context:
space:
mode:
authoreivind <eivind@FreeBSD.org>1997-10-07 16:27:48 +0000
committereivind <eivind@FreeBSD.org>1997-10-07 16:27:48 +0000
commit5e35aa322b9a127738721b3992c1f585050469d8 (patch)
treef5d2a614e89ea24bdce34d896b4fe53a5f55b868 /bin/csh
parent5ef7e29fe83f716077f0fe33d5df5bcad0d5308f (diff)
downloadFreeBSD-src-5e35aa322b9a127738721b3992c1f585050469d8.zip
FreeBSD-src-5e35aa322b9a127738721b3992c1f585050469d8.tar.gz
Don't honor $HOME if >= MAXPATHLEN
Obtained from: Todd Miller <millert@openbsd.org> (OpenBSD csh.c rev 1.3 and 1.4)
Diffstat (limited to 'bin/csh')
-rw-r--r--bin/csh/csh.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/csh/csh.c b/bin/csh/csh.c
index 29fbf5e..91f1eca 100644
--- a/bin/csh/csh.c
+++ b/bin/csh/csh.c
@@ -42,13 +42,14 @@ static const char copyright[] =
static char sccsid[] = "@(#)csh.c 8.2 (Berkeley) 10/12/93";
#else
static const char rcsid[] =
- "$Id: csh.c,v 1.9 1997/08/07 21:42:03 steve Exp $";
+ "$Id: csh.c,v 1.10 1997/08/08 00:49:25 steve Exp $";
#endif
#endif /* not lint */
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
+#include <sys/param.h>
#include <fcntl.h>
#include <errno.h>
#include <pwd.h>
@@ -232,7 +233,7 @@ main(argc, argv)
*/
set(STRstatus, Strsave(STR0));
- if ((tcp = getenv("HOME")) != NULL)
+ if ((tcp = getenv("HOME")) != NULL && strlen(tcp) < MAXPATHLEN)
cp = SAVE(tcp);
else
cp = NULL;
OpenPOWER on IntegriCloud