summaryrefslogtreecommitdiff
path: root/usr.sbin/tcpdump
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2000-10-31 16:06:50 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2000-10-31 16:06:50 +0000
commit6458c7204b16a44af80ae092c3774fcaaba43b63 (patch)
tree55e9f6d4ddb2ce91cd263a9a038ea87987e41d05 /usr.sbin/tcpdump
parent0240837695c0242b03f6debd86a0fe268ab6666a (diff)
some buffer care; jakob
Diffstat (limited to 'usr.sbin/tcpdump')
-rw-r--r--usr.sbin/tcpdump/addrtoname.c8
-rw-r--r--usr.sbin/tcpdump/print-atalk.c6
-rw-r--r--usr.sbin/tcpdump/util.c6
3 files changed, 10 insertions, 10 deletions
diff --git a/usr.sbin/tcpdump/addrtoname.c b/usr.sbin/tcpdump/addrtoname.c
index ad02cdfa129..6b693013400 100644
--- a/usr.sbin/tcpdump/addrtoname.c
+++ b/usr.sbin/tcpdump/addrtoname.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: addrtoname.c,v 1.15 2000/10/03 14:31:54 ho Exp $ */
+/* $OpenBSD: addrtoname.c,v 1.16 2000/10/31 16:06:46 deraadt Exp $ */
/*
* Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -25,7 +25,7 @@
*/
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/addrtoname.c,v 1.15 2000/10/03 14:31:54 ho Exp $ (LBL)";
+ "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/addrtoname.c,v 1.16 2000/10/31 16:06:46 deraadt Exp $ (LBL)";
#endif
#include <sys/types.h>
@@ -654,7 +654,7 @@ tcpport_string(u_short port)
tp->addr = i;
tp->nxt = newhnamemem();
- (void)sprintf(buf, "%u", i);
+ (void)snprintf(buf, sizeof(buf), "%u", i);
tp->name = savestr(buf);
return (tp->name);
}
@@ -699,7 +699,7 @@ init_servarray(void)
while (table->name)
table = table->nxt;
if (nflag) {
- (void)sprintf(buf, "%d", port);
+ (void)snprintf(buf, sizeof(buf), "%d", port);
table->name = savestr(buf);
} else
table->name = savestr(sv->s_name);
diff --git a/usr.sbin/tcpdump/print-atalk.c b/usr.sbin/tcpdump/print-atalk.c
index 60ea9d6e919..7c8135b8a66 100644
--- a/usr.sbin/tcpdump/print-atalk.c
+++ b/usr.sbin/tcpdump/print-atalk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-atalk.c,v 1.15 2000/10/03 14:31:56 ho Exp $ */
+/* $OpenBSD: print-atalk.c,v 1.16 2000/10/31 16:06:48 deraadt Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -25,7 +25,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-atalk.c,v 1.15 2000/10/03 14:31:56 ho Exp $ (LBL)";
+ "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-atalk.c,v 1.16 2000/10/31 16:06:48 deraadt Exp $ (LBL)";
#endif
#include <sys/param.h>
@@ -544,7 +544,7 @@ ataddr_string(u_short atnet, u_char athost)
{
register struct hnamemem *tp, *tp2;
register int i = (atnet << 8) | athost;
- char nambuf[256];
+ char nambuf[MAXHOSTNAMELEN + 20];
static int first = 1;
FILE *fp;
diff --git a/usr.sbin/tcpdump/util.c b/usr.sbin/tcpdump/util.c
index af51e1f8eee..c788bb9086a 100644
--- a/usr.sbin/tcpdump/util.c
+++ b/usr.sbin/tcpdump/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.9 2000/10/03 14:31:59 ho Exp $ */
+/* $OpenBSD: util.c,v 1.10 2000/10/31 16:06:49 deraadt Exp $ */
/*
* Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996, 1997
@@ -23,7 +23,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/util.c,v 1.9 2000/10/03 14:31:59 ho Exp $ (LBL)";
+ "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/util.c,v 1.10 2000/10/31 16:06:49 deraadt Exp $ (LBL)";
#endif
#include <sys/types.h>
@@ -153,7 +153,7 @@ tok2str(register const struct tok *lp, register const char *fmt,
}
if (fmt == NULL)
fmt = "#%d";
- (void)sprintf(buf, fmt, v);
+ (void)snprintf(buf, sizeof(buf), fmt, v);
return (buf);
}