examples/power: fix buffer overrun
authorDavid Hunt <david.hunt@intel.com>
Fri, 26 Apr 2019 08:42:09 +0000 (09:42 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 2 May 2019 23:38:46 +0000 (01:38 +0200)
commit3f1fc5f2cbc57ed719f9a1b24c8e450c5a95e8db
tree3d391af051298a0053a8317ae6896ef7c4561c49
parent7c22ccdd91bc91e60f1ee32a3c79192a172dc5ea
examples/power: fix buffer overrun

The freqs array in freq_info struct has RTE_MAX_LCORE_FREQS elements,
yet the code can attempt to look at the index at  RTE_MAX_LCORE,
which may be greater than RTE_MAX_LCORE_FREQS. Fix to limit index to
RTE_MAX_LCORE_FREQS.

Coverity issue: 337660
Fixes: d26c18c93260 ("examples/vm_power: cpu frequency in host")
Cc: stable@dpdk.org
Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
examples/vm_power_manager/power_manager.c