summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorBruce Richardson <bruce.richardson@intel.com>2018-07-16 17:03:47 +0100
committerThomas Monjalon <thomas@monjalon.net>2018-07-26 19:53:56 +0200
commit4341adf272144689540a8e0f615f12eef7e21109 (patch)
tree0d9843028f1a5c95d63ae79c47dc023f1f311370 /examples
parent2e9bf3a12aaad73294f50bd43420ab62588333f3 (diff)
downloaddpdk-4341adf272144689540a8e0f615f12eef7e21109.zip
dpdk-4341adf272144689540a8e0f615f12eef7e21109.tar.gz
dpdk-4341adf272144689540a8e0f615f12eef7e21109.tar.xz
examples/exception_path: fix out-of-bounds read
When printing out stats from the exception_path app, all possible lcore_ids are iterated. However, the app only supports up to 64 cores. To prevent possible errors, and to remove coverity warnings, explicitly check for out-of-range lcore ids before printing. Coverity issue: 268335 Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/exception_path/main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c
index 0b59f6b..440422b 100644
--- a/examples/exception_path/main.c
+++ b/examples/exception_path/main.c
@@ -131,6 +131,9 @@ print_stats(void)
" Lcore Port RX TX Dropped on TX\n"
"------- ------ ------------ ------------ ---------------\n");
RTE_LCORE_FOREACH(i) {
+ /* limit ourselves to application supported cores only */
+ if (i >= APP_MAX_LCORE)
+ break;
printf("%6u %7u %13"PRIu64" %13"PRIu64" %16"PRIu64"\n",
i, (unsigned)port_ids[i],
lcore_stats[i].rx, lcore_stats[i].tx,