summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2004-02-23 19:06:51 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2004-02-23 19:06:51 +0000
commitc9dc116c74153ca63942692e3cdfffa1ee8205a9 (patch)
tree1ece6e9a15ab00979077f6024146402018e5ecf7 /sys/net
parenta499f3122f79b44dd383f7f4633063046041a136 (diff)
prevent backward jumps; pls@egsys.hu; ok canacar, deraadt
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/bpf_filter.c5
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)