From: Konstantin Ananyev Date: Wed, 27 Mar 2019 09:33:27 +0000 (+0000) Subject: examples/ipsec-secgw: fix out-of-bound check X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=7831bcf026cf3a662c027310a04a99113500a6fe;p=dpdk.git examples/ipsec-secgw: fix out-of-bound check Coverity issue: 336791 Fixes: 7622291b641d ("examples/ipsec-secgw: allow to specify neighbour MAC address") Cc: stable@dpdk.org Signed-off-by: Konstantin Ananyev Acked-by: Akhil Goyal --- diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c index b253eea2bf..ffbd00b080 100644 --- a/examples/ipsec-secgw/ipsec-secgw.c +++ b/examples/ipsec-secgw/ipsec-secgw.c @@ -1439,7 +1439,7 @@ print_ethaddr(const char *name, const struct ether_addr *eth_addr) int add_dst_ethaddr(uint16_t port, const struct ether_addr *addr) { - if (port > RTE_DIM(ethaddr_tbl)) + if (port >= RTE_DIM(ethaddr_tbl)) return -EINVAL; ethaddr_tbl[port].dst = ETHADDR_TO_UINT64(addr);