]> git.droids-corp.org - dpdk.git/blobdiff - lib/librte_bpf/bpf_validate.c
bpf: fix check array size
[dpdk.git] / lib / librte_bpf / bpf_validate.c
index 83983efc4e5c4df90143ad41b2c45fd4f0a3d85d..d0e683b5b21f060773d594c6207a456a514c037a 100644 (file)
@@ -1084,7 +1084,7 @@ eval_jcc(struct bpf_verifier *bvf, const struct ebpf_insn *ins)
 /*
  * validate parameters for each instruction type.
  */
-static const struct bpf_ins_check ins_chk[UINT8_MAX] = {
+static const struct bpf_ins_check ins_chk[UINT8_MAX + 1] = {
        /* ALU IMM 32-bit instructions */
        [(BPF_ALU | BPF_ADD | BPF_K)] = {
                .mask = {.dreg = WRT_REGS, .sreg = ZERO_REG},