summaryrefslogtreecommitdiff
path: root/usr.sbin/tcpdump/print-ipx.c
diff options
context:
space:
mode:
authorMoritz Jodeit <moritz@cvs.openbsd.org>2006-05-29 17:41:15 +0000
committerMoritz Jodeit <moritz@cvs.openbsd.org>2006-05-29 17:41:15 +0000
commit025c4b78bee1c06d28ef268ef542bb2e93335a95 (patch)
tree474d38d7551bda97e1294f911071fcf486d7f8b4 /usr.sbin/tcpdump/print-ipx.c
parent8551b0728e9cc29416baac4e1f3063c639680ad6 (diff)
The end pointer to fn_print() could possibly point behind the captured
packet. So make sure, it uses "snapend" in that case. ok canacar@
Diffstat (limited to 'usr.sbin/tcpdump/print-ipx.c')
-rw-r--r--usr.sbin/tcpdump/print-ipx.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/tcpdump/print-ipx.c b/usr.sbin/tcpdump/print-ipx.c
index e0e51a49deb..9e771cf2ccf 100644
--- a/usr.sbin/tcpdump/print-ipx.c
+++ b/usr.sbin/tcpdump/print-ipx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-ipx.c,v 1.9 2002/02/19 19:39:40 millert Exp $ */
+/* $OpenBSD: print-ipx.c,v 1.10 2006/05/29 17:41:14 moritz Exp $ */
/*
* Copyright (c) 1994, 1995, 1996
@@ -26,7 +26,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-ipx.c,v 1.9 2002/02/19 19:39:40 millert Exp $";
+ "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-ipx.c,v 1.10 2006/05/29 17:41:14 moritz Exp $";
#endif
#include <sys/param.h>
@@ -143,7 +143,7 @@ ipx_sap_print(const u_short *ipx, u_int length)
if (length > 0) {
TCHECK(ipx[1]);
(void)printf(" %x '", EXTRACT_16BITS(&ipx[0]));
- fn_print((u_char *)&ipx[1], (u_char *)&ipx[1] + 48);
+ fn_print((u_char *)&ipx[1], min(snapend, (u_char *)&ipx[1] + 48));
putchar('\'');
}
break;
@@ -158,7 +158,7 @@ ipx_sap_print(const u_short *ipx, u_int length)
for (i = 0; i < 8 && length > 0; i++) {
TCHECK2(ipx[27], 1);
(void)printf(" %x '", EXTRACT_16BITS(&ipx[0]));
- fn_print((u_char *)&ipx[1], (u_char *)&ipx[1] + 48);
+ fn_print((u_char *)&ipx[1], min(snapend, (u_char *)&ipx[1] + 48));
printf("' addr %s",
ipxaddr_string(EXTRACT_32BITS(&ipx[25]), (u_char *)&ipx[27]));
ipx += 32;