From: Amr Mokhtar Date: Wed, 31 Jan 2018 14:19:34 +0000 (+0000) Subject: examples/bbdev: fix out-of-bounds access in MAC print X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=bf271db17154b0fcddc7c79edfa7b4e653d6a796;p=dpdk.git examples/bbdev: fix out-of-bounds access in MAC print eth_address was improperly accessed in bbdev example app, this patch removes the use of port_id, it is irrelevant here. Coverity issue: 257021 Fixes: 1ffee690eaa1 ("examples/bbdev: add sample app") Signed-off-by: Amr Mokhtar --- diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c index 2e5bd8c975..a2835a4d4f 100644 --- a/examples/bbdev_app/main.c +++ b/examples/bbdev_app/main.c @@ -282,12 +282,12 @@ print_mac(unsigned int portid, struct ether_addr *bbdev_ports_eth_address) { printf("Port %u, MAC address: %02X:%02X:%02X:%02X:%02X:%02X\n\n", (unsigned int) portid, - bbdev_ports_eth_address[portid].addr_bytes[0], - bbdev_ports_eth_address[portid].addr_bytes[1], - bbdev_ports_eth_address[portid].addr_bytes[2], - bbdev_ports_eth_address[portid].addr_bytes[3], - bbdev_ports_eth_address[portid].addr_bytes[4], - bbdev_ports_eth_address[portid].addr_bytes[5]); + bbdev_ports_eth_address->addr_bytes[0], + bbdev_ports_eth_address->addr_bytes[1], + bbdev_ports_eth_address->addr_bytes[2], + bbdev_ports_eth_address->addr_bytes[3], + bbdev_ports_eth_address->addr_bytes[4], + bbdev_ports_eth_address->addr_bytes[5]); } static inline void