summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-07-14 00:01:12 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-07-14 00:01:12 +0000
commit8966093c128ff116f0b986a0e7921ef73d29d3ad (patch)
treee53958fa26de8b811ddc4b8708dbd32dc92c1eb6 /usr.sbin
parent071047724f2778653d6a76a475952481dd034178 (diff)
buf oflow
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/tcpdump/print-sunrpc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/tcpdump/print-sunrpc.c b/usr.sbin/tcpdump/print-sunrpc.c
index 380a9345a4d..876401033a7 100644
--- a/usr.sbin/tcpdump/print-sunrpc.c
+++ b/usr.sbin/tcpdump/print-sunrpc.c
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-sunrpc.c,v 1.6 1997/07/25 20:12:27 mickey Exp $ (LBL)";
+ "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-sunrpc.c,v 1.7 1998/07/14 00:01:11 deraadt Exp $ (LBL)";
#endif
#include <sys/param.h>
@@ -126,7 +126,9 @@ progstr(prog)
rp = getrpcbynumber(prog);
if (rp == NULL)
(void) sprintf(buf, "#%u", prog);
- else
- strcpy(buf, rp->r_name);
+ else {
+ strncpy(buf, rp->r_name, sizeof buf-1);
+ buf[sizeof buf-1] = '\0';
+ }
return (buf);
}