summaryrefslogtreecommitdiff
path: root/lib/libcurses/tinfo/read_bsd_terminfo.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 /lib/libcurses/tinfo/read_bsd_terminfo.c
parent3602a750205b32f442e2e132baa5b3e9a3c83349 (diff)
$HOME paranoia: never use getenv("HOME") w/o checking for NULL and non-zero
Diffstat (limited to 'lib/libcurses/tinfo/read_bsd_terminfo.c')
-rw-r--r--lib/libcurses/tinfo/read_bsd_terminfo.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libcurses/tinfo/read_bsd_terminfo.c b/lib/libcurses/tinfo/read_bsd_terminfo.c
index 2fda122ec18..45d308e7b10 100644
--- a/lib/libcurses/tinfo/read_bsd_terminfo.c
+++ b/lib/libcurses/tinfo/read_bsd_terminfo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: read_bsd_terminfo.c,v 1.7 2000/01/08 06:26:25 millert Exp $ */
+/* $OpenBSD: read_bsd_terminfo.c,v 1.8 2000/08/02 04:10:47 millert Exp $ */
/*
* Copyright (c) 1998, 1999, 2000 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -28,7 +28,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: read_bsd_terminfo.c,v 1.7 2000/01/08 06:26:25 millert Exp $";
+static char rcsid[] = "$OpenBSD: read_bsd_terminfo.c,v 1.8 2000/08/02 04:10:47 millert Exp $";
#endif
#include <curses.priv.h>
@@ -67,7 +67,7 @@ _nc_read_bsd_terminfo_entry(tn, filename, tp)
}
/* Also check $HOME/.terminfo if it exists */
- if (!issetugid() && (p = getenv("HOME")) != NULL) {
+ if (!issetugid() && (p = getenv("HOME")) != NULL && *p != '\0') {
len = snprintf(hometerm, sizeof(hometerm), "%s/.terminfo", p);
if (len < sizeof(hometerm))
*fname++ = hometerm;