diff options
-rw-r--r-- | sys/net/bpf_filter.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/net/bpf_filter.c b/sys/net/bpf_filter.c index ed36cca3c5b..0468a06f659 100644 --- a/sys/net/bpf_filter.c +++ b/sys/net/bpf_filter.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bpf_filter.c,v 1.12 2003/12/10 07:22:42 itojun Exp $ */ +/* $OpenBSD: bpf_filter.c,v 1.13 2004/02/23 19:06:50 markus Exp $ */ /* $NetBSD: bpf_filter.c,v 1.12 1996/02/13 22:00:00 christos Exp $ */ /* @@ -495,7 +495,8 @@ bpf_validate(f, len) int from = i + 1; if (BPF_OP(p->code) == BPF_JA) { - if (from + p->k >= len) + if (from + p->k < from || + from + p->k >= len) return 0; } else if (from + p->jt >= len || from + p->jf >= len) |