[dpdk-dev] [PATCH 1/3] examples/ipsec-secgw: fix invalid out-of-bound check

Konstantin Ananyev konstantin.ananyev at intel.com
Wed Mar 27 10:33:27 CET 2019


Fixes: 7622291b641d ("examples/ipsec-secgw: allow to specify neighbour MAC address")
Coverity issue: 336791

Signed-off-by: Konstantin Ananyev <konstantin.ananyev at intel.com>
---
 examples/ipsec-secgw/ipsec-secgw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index b253eea2b..ffbd00b08 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);
-- 
2.17.1



More information about the dev mailing list