diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-08-31 01:20:49 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-08-31 01:20:49 +0000 |
commit | 4add8efd82adb5b7cc333f1cb445de36b36a2605 (patch) | |
tree | a1a4d5ead251e1acefd2a4e9c63de3584b9542d5 /usr.sbin | |
parent | 77b2fd827eb00da887ec3ea7ba831608ae3bb5eb (diff) |
buf oflow, found by das33@cornell.edu
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/rpc.bootparamd/bootparamd.c | 8 |
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) { |