summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rpc.bootparamd
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1996-08-31 01:20:48 +0000
committerderaadt <deraadt@openbsd.org>1996-08-31 01:20:48 +0000
commit00be5615e88d2c9f09f3c869247ed6b6590b3174 (patch)
tree90f6eec4a8db3024f0eb199182ceab0088a29ad1 /usr.sbin/rpc.bootparamd
parentWe're not ready for this, yet. (diff)
downloadwireguard-openbsd-00be5615e88d2c9f09f3c869247ed6b6590b3174.tar.xz
wireguard-openbsd-00be5615e88d2c9f09f3c869247ed6b6590b3174.zip
buf oflow, found by das33@cornell.edu
Diffstat (limited to 'usr.sbin/rpc.bootparamd')
-rw-r--r--usr.sbin/rpc.bootparamd/bootparamd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/rpc.bootparamd/bootparamd.c b/usr.sbin/rpc.bootparamd/bootparamd.c
index 19204685db8..418bed19071 100644
--- a/usr.sbin/rpc.bootparamd/bootparamd.c
+++ b/usr.sbin/rpc.bootparamd/bootparamd.c
@@ -6,7 +6,7 @@
* Various small changes by Theo de Raadt <deraadt@fsa.ca>
* Parser rewritten (adding YP support) by Roland McGrath <roland@frob.com>
*
- * $Id: bootparamd.c,v 1.2 1996/04/21 23:41:48 deraadt Exp $
+ * $Id: bootparamd.c,v 1.3 1996/08/31 01:20:48 deraadt Exp $
*/
#include <sys/types.h>
@@ -174,7 +174,8 @@ bootparamproc_whoami_1_svc(whoami, rqstp)
if (dolog)
syslog(LOG_NOTICE, "This is host %s\n", he->h_name);
- strcpy(askname, he->h_name);
+ strncpy(askname, he->h_name, sizeof askname-1);
+ askname[sizeof askname-1] = '\0';
if (!lookup_bootparam(askname, hostname, NULL, NULL, NULL)) {
res.client_name = hostname;
getdomainname(domain_name, MAX_MACHINE_NAME);
@@ -232,7 +233,8 @@ bootparamproc_getfile_1_svc(getfile, rqstp)
if (!he)
goto failed;
- strcpy(askname, he->h_name);
+ strncpy(askname, he->h_name, sizeof askname-1);
+ askname[sizeof askname-1] = '\0';
err = lookup_bootparam(askname, NULL, getfile->file_id,
&res.server_name, &res.server_path);
if (err == 0) {