[dpdk-dev,v2] examples/l2fwd-crypto: fix out-of-bounds read

Message ID 1467277534-6955-1-git-send-email-slawomirx.mrozowicz@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers

Commit Message

Slawomir Mrozowicz June 30, 2016, 9:05 a.m. UTC
  Overrunning array crypto_statistics of 32 64-byte elements
at element index 63 using index cdevid.
Fixed by extend crypto_statistics array.

Coverity ID 120145
Fixes: 387259bd6c67 ("examples/l2fwd-crypto: add sample application")

Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
---
v2:
- correct commit description
---
 examples/l2fwd-crypto/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index 8dc616d..70fada5 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -243,7 +243,7 @@  struct l2fwd_crypto_statistics {
 } __rte_cache_aligned;
 
 struct l2fwd_port_statistics port_statistics[RTE_MAX_ETHPORTS];
-struct l2fwd_crypto_statistics crypto_statistics[RTE_MAX_ETHPORTS];
+struct l2fwd_crypto_statistics crypto_statistics[RTE_CRYPTO_MAX_DEVS];
 
 /* A tsc-based timer responsible for triggering statistics printout */
 #define TIMER_MILLISECOND 2000000ULL /* around 1ms at 2 Ghz */