metrics: add check for invalid key
authorRemy Horton <remy.horton@intel.com>
Fri, 6 Jul 2018 13:21:19 +0000 (14:21 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 26 Jul 2018 18:12:02 +0000 (20:12 +0200)
commit50d2459fdde1916c2ebce1a3751ab2fa59c0766f
tree25583cd22e8cfd38353d242001a9259cae186f2a
parent90b0e5aaf4e3a56a4dac57aceb425930450cec85
metrics: add check for invalid key

This patchset adds a check to rte_metrics_update_values()
that prevents the updating of metrics when presented with
an invalid metric key. Previously, doing the latter could
result in a crash.

Fixes: 349950ddb9c5 ("metrics: add information metrics library")
Cc: stable@dpdk.org
Signed-off-by: Remy Horton <remy.horton@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
lib/librte_metrics/rte_metrics.c