diff options
author | dm <dm@cvs.openbsd.org> | 1996-09-29 08:11:05 +0000 |
---|---|---|
committer | dm <dm@cvs.openbsd.org> | 1996-09-29 08:11:05 +0000 |
commit | 05b09811a75b45d5c736f40f12dff5639acdb9aa (patch) | |
tree | 8e86f4c14e312c4a868d5ba40d3366735e7b67be /usr.sbin | |
parent | 7cce8a6a2b628f3433d2f677d47e19676f28e6be (diff) |
Fix hostname lookups (improper use of strncpy).
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ypserv/ypserv/ypserv_db.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/ypserv/ypserv/ypserv_db.c b/usr.sbin/ypserv/ypserv/ypserv_db.c index e6906bfccca..b2570cbe740 100644 --- a/usr.sbin/ypserv/ypserv/ypserv_db.c +++ b/usr.sbin/ypserv/ypserv/ypserv_db.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ypserv_db.c,v 1.6 1996/06/27 20:25:54 deraadt Exp $ */ +/* $OpenBSD: ypserv_db.c,v 1.7 1996/09/29 08:11:04 dm Exp $ */ /* * Copyright (c) 1994 Mats O Jansson <moj@stacken.kth.se> @@ -34,7 +34,7 @@ */ #ifndef LINT -static char rcsid[] = "$OpenBSD: ypserv_db.c,v 1.6 1996/06/27 20:25:54 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: ypserv_db.c,v 1.7 1996/09/29 08:11:04 dm Exp $"; #endif /* @@ -492,6 +492,7 @@ ypdb_get_record(domain, map, key, ypprivate) return(res); /* note: lookup_host needs null terminated string */ strncpy(keystr, key.keydat_val, key.keydat_len); + keystr[key.keydat_len] = '\0'; res.stat = lookup_host((hn == 0) ? TRUE : FALSE, host_lookup, db, keystr, &res); } else { |