diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2000-08-02 04:10:51 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2000-08-02 04:10:51 +0000 |
commit | eb9184a174a8fb2f98f2f1418f87863716a5c115 (patch) | |
tree | 02b606fefe2b41782be054be7fdd586e53befba0 /usr.bin/telnet | |
parent | 3602a750205b32f442e2e132baa5b3e9a3c83349 (diff) |
$HOME paranoia: never use getenv("HOME") w/o checking for NULL and non-zero
Diffstat (limited to 'usr.bin/telnet')
-rw-r--r-- | usr.bin/telnet/commands.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/telnet/commands.c b/usr.bin/telnet/commands.c index d11f8de5c66..2b67ac56b6c 100644 --- a/usr.bin/telnet/commands.c +++ b/usr.bin/telnet/commands.c @@ -1,4 +1,4 @@ -/* $OpenBSD: commands.c,v 1.28 2000/04/30 23:57:08 millert Exp $ */ +/* $OpenBSD: commands.c,v 1.29 2000/08/02 04:10:49 millert Exp $ */ /* $NetBSD: commands.c,v 1.14 1996/03/24 22:03:48 jtk Exp $ */ /* @@ -2202,6 +2202,8 @@ cmdrc(char *m1, char *m2) if (rcname[0] == 0) { char *home = getenv("HOME"); + if (home == NULL || *home == '\0') + return; snprintf (rcname, sizeof(rcname), "%s/.telnetrc", home ? home : ""); } |