diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2004-02-23 19:06:51 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2004-02-23 19:06:51 +0000 |
commit | c9dc116c74153ca63942692e3cdfffa1ee8205a9 (patch) | |
tree | 1ece6e9a15ab00979077f6024146402018e5ecf7 /sys/net | |
parent | a499f3122f79b44dd383f7f4633063046041a136 (diff) |
prevent backward jumps; pls@egsys.hu; ok canacar, deraadt
Diffstat (limited to 'sys/net')
-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) |