diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1996-10-28 01:06:20 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1996-10-28 01:06:20 +0000 |
commit | 444b93f39ec7fc1e22431e1bf74cf3484d402ab1 (patch) | |
tree | 701d24ed62a444c0d7e5a25028400e2b97e624e7 | |
parent | bef4d5ffdda4f2cfc7fb3cbcff6b969c02ec7e26 (diff) |
Safe $HOME handling.
-rw-r--r-- | usr.sbin/named/nslookup/main.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/named/nslookup/main.c b/usr.sbin/named/nslookup/main.c index 50b9c491147..8d78510002c 100644 --- a/usr.sbin/named/nslookup/main.c +++ b/usr.sbin/named/nslookup/main.c @@ -1097,7 +1097,9 @@ ReadRC() register char *cp; char buf[PATH_MAX]; - if ((cp = getenv("HOME")) != NULL) { + if ((cp = getenv("HOME")) != NULL && + (strlen(cp) + strlen(_PATH_NSLOOKUPRC)) < sizeof(buf)) { + (void) strcpy(buf, cp); (void) strcat(buf, _PATH_NSLOOKUPRC); |