From: Amr Mokhtar <amr.mokhtar@intel.com>
To: dev@dpdk.org
Cc: Amr Mokhtar <amr.mokhtar@intel.com>
Subject: [dpdk-dev] [PATCH] examples/bbdev: fix out-of-bounds access
Date: Wed, 31 Jan 2018 14:19:34 +0000 [thread overview]
Message-ID: <1517408374-131055-1-git-send-email-amr.mokhtar@intel.com> (raw)
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 <amr.mokhtar@intel.com>
---
examples/bbdev_app/main.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c
index 2e5bd8c..a2835a4 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
--
2.7.4
next reply other threads:[~2018-01-31 14:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-31 14:19 Amr Mokhtar [this message]
2018-01-31 17:27 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1517408374-131055-1-git-send-email-amr.mokhtar@intel.com \
--to=amr.mokhtar@intel.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).