summaryrefslogtreecommitdiff
path: root/usr.bin/window/startup.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2000-08-02 04:10:51 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2000-08-02 04:10:51 +0000
commiteb9184a174a8fb2f98f2f1418f87863716a5c115 (patch)
tree02b606fefe2b41782be054be7fdd586e53befba0 /usr.bin/window/startup.c
parent3602a750205b32f442e2e132baa5b3e9a3c83349 (diff)
$HOME paranoia: never use getenv("HOME") w/o checking for NULL and non-zero
Diffstat (limited to 'usr.bin/window/startup.c')
-rw-r--r--usr.bin/window/startup.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/window/startup.c b/usr.bin/window/startup.c
index c7822d6c73d..a747de6f29c 100644
--- a/usr.bin/window/startup.c
+++ b/usr.bin/window/startup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: startup.c,v 1.4 1997/02/25 00:04:17 downsj Exp $ */
+/* $OpenBSD: startup.c,v 1.5 2000/08/02 04:10:50 millert Exp $ */
/* $NetBSD: startup.c,v 1.4 1996/02/08 20:45:04 mycroft Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)startup.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: startup.c,v 1.4 1997/02/25 00:04:17 downsj Exp $";
+static char rcsid[] = "$OpenBSD: startup.c,v 1.5 2000/08/02 04:10:50 millert Exp $";
#endif
#endif /* not lint */
@@ -58,8 +58,8 @@ doconfig()
char *home;
static char runcom[] = RUNCOM;
- if ((home = getenv("HOME")) == 0)
- home = ".";
+ if ((home = getenv("HOME")) == NULL || *home == '\0')
+ return -1;
(void) sprintf(buf, "%.*s/%s",
(sizeof buf - sizeof runcom) / sizeof (char) - 1,
home, runcom);