diff options
author | 2006-12-26 18:22:30 +0000 | |
---|---|---|
committer | 2006-12-26 18:22:30 +0000 | |
commit | d9a8b05dc482529087153038c08416ae7e92ba4c (patch) | |
tree | a9acfb357640b936ab44a8c3b8109f928c84136e /usr.sbin/tcpdump/print-ipsec.c | |
parent | Don't re-initialize the card every time the IP address is changed. (diff) | |
download | wireguard-openbsd-d9a8b05dc482529087153038c08416ae7e92ba4c.tar.xz wireguard-openbsd-d9a8b05dc482529087153038c08416ae7e92ba4c.zip |
Fix truncation check by directly comparing both values and don't
compare the unsigned value of the subtraction against <= 0.
ok krw@ ray@
Diffstat (limited to 'usr.sbin/tcpdump/print-ipsec.c')
-rw-r--r-- | usr.sbin/tcpdump/print-ipsec.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/tcpdump/print-ipsec.c b/usr.sbin/tcpdump/print-ipsec.c index dd56aa949ab..064efb294b2 100644 --- a/usr.sbin/tcpdump/print-ipsec.c +++ b/usr.sbin/tcpdump/print-ipsec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-ipsec.c,v 1.10 2006/12/26 06:24:48 itojun Exp $ */ +/* $OpenBSD: print-ipsec.c,v 1.11 2006/12/26 18:22:30 moritz Exp $ */ /* * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999 @@ -28,7 +28,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /home/cvs/src/usr.sbin/tcpdump/print-ipsec.c,v 1.10 2006/12/26 06:24:48 itojun Exp $ (XXX)"; + "@(#) $Header: /home/cvs/src/usr.sbin/tcpdump/print-ipsec.c,v 1.11 2006/12/26 18:22:30 moritz Exp $ (XXX)"; #endif #include <sys/param.h> @@ -289,7 +289,7 @@ ah_print (register const u_char *bp, register u_int len, pl_len = (ah->ah_pl_len + 2) << 2; /* RFC2402, sec 2.2 */ - if (len - pl_len <= 0) { + if (len <= pl_len) { (void)printf("truncated"); goto out; } |