aboutsummaryrefslogtreecommitdiff
path: root/bpf_filter.c
diff options
context:
space:
mode:
Diffstat (limited to 'bpf_filter.c')
-rw-r--r--bpf_filter.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/bpf_filter.c b/bpf_filter.c
index e5c286b5..b19b25d1 100644
--- a/bpf_filter.c
+++ b/bpf_filter.c
@@ -302,11 +302,17 @@ pcap_filter_with_aux_data(const struct bpf_insn *pc, const u_char *p,
continue;
case BPF_ALU|BPF_LSH|BPF_X:
- A <<= X;
+ if (X < 32)
+ A <<= X;
+ else
+ A = 0;
continue;
case BPF_ALU|BPF_RSH|BPF_X:
- A >>= X;
+ if (X < 32)
+ A >>= X;
+ else
+ A = 0;
continue;
case BPF_ALU|BPF_ADD|BPF_K: