From: Slawomir Mrozowicz Date: Thu, 30 Jun 2016 09:05:34 +0000 (+0200) Subject: examples/l2fwd-crypto: fix stats array length X-Git-Tag: spdx-start~6199 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=572f0779c2dc88c3c225fc06ff5d062f6f425c31;p=dpdk.git examples/l2fwd-crypto: fix stats array length crypto_statistics array was not big enough for storing all the possible crypto device statistics, as its size was RTE_MAX_ETHPORTS, but should be RTE_CRYPTO_MAX_DEVS, leading this to a potential out-of-bounds issue. Coverity issue: 120145 Fixes: 387259bd6c67 ("examples/l2fwd-crypto: add sample application") Signed-off-by: Slawomir Mrozowicz Signed-off-by: Pablo de Lara Acked-by: Declan Doherty --- diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c index 23b20b1e29..a1ce7127ed 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 */