summaryrefslogtreecommitdiffstats
path: root/usr.sbin/tcpdump/print-sunrpc.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1998-07-14 00:01:11 +0000
committerderaadt <deraadt@openbsd.org>1998-07-14 00:01:11 +0000
commit1554f4a4ae2eab38be8b6a8224cd0d6a4036b6d5 (patch)
tree6544d29f9e3cabc15426d518c735d849e5d7796f /usr.sbin/tcpdump/print-sunrpc.c
parentquiet that dd (diff)
downloadwireguard-openbsd-1554f4a4ae2eab38be8b6a8224cd0d6a4036b6d5.tar.xz
wireguard-openbsd-1554f4a4ae2eab38be8b6a8224cd0d6a4036b6d5.zip
buf oflow
Diffstat (limited to 'usr.sbin/tcpdump/print-sunrpc.c')
-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 ea7e752e2c7..cd68f30079a 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: /home/cvs/src/usr.sbin/tcpdump/print-sunrpc.c,v 1.6 1997/07/25 20:12:27 mickey Exp $ (LBL)";
+ "@(#) $Header: /home/cvs/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);
}