diff options
author | bde <bde@FreeBSD.org> | 1999-07-04 08:07:35 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1999-07-04 08:07:35 +0000 |
commit | e49a79514f79deb4a0c2396c334dc7158edb95b1 (patch) | |
tree | b9d86a1409ba5ebd99534ad86ab904cf60e9f38a | |
parent | 0c6556f86e00ec4f795187d30ebeeb74c3888114 (diff) | |
download | FreeBSD-src-e49a79514f79deb4a0c2396c334dc7158edb95b1.zip FreeBSD-src-e49a79514f79deb4a0c2396c334dc7158edb95b1.tar.gz |
Quick fix for breakage of bounds checking in rev.1.12. Only one
of the additional checks in rev.1.12 was wrong. The others are a
bit inconsistent and are probably unnecessarily pessimal. Checking
for overflow of addition, if necessary at all, should be done in
bpf_validate().
PR: 12484
-rw-r--r-- | sys/net/bpf_filter.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/bpf_filter.c b/sys/net/bpf_filter.c index 600172a..ab2b088 100644 --- a/sys/net/bpf_filter.c +++ b/sys/net/bpf_filter.c @@ -37,7 +37,7 @@ * * @(#)bpf_filter.c 8.1 (Berkeley) 6/10/93 * - * $Id: bpf_filter.c,v 1.12 1998/12/07 16:31:15 eivind Exp $ + * $Id: bpf_filter.c,v 1.13 1999/04/11 02:52:31 eivind Exp $ */ #include <sys/param.h> @@ -330,7 +330,7 @@ bpf_filter(pc, p, wirelen, buflen) case BPF_LD|BPF_B|BPF_IND: k = X + pc->k; - if (pc->k >= buflen || X >= buflen - k) { + if (pc->k >= buflen || X >= buflen - pc->k) { #ifdef KERNEL register struct mbuf *m; |