bitrate: add sanity check on parameters
authorRemy Horton <remy.horton@intel.com>
Thu, 12 Jul 2018 10:49:48 +0000 (11:49 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 26 Jul 2018 18:07:57 +0000 (20:07 +0200)
commit90b0e5aaf4e3a56a4dac57aceb425930450cec85
treee2ccb3ea4cad6f1bc94855c88debd2f09d10f41a
parent8dedd737452fe2c8d74cce786aa6cc0ea91ed5c0
bitrate: add sanity check on parameters

If rte_stats_bitrate_reg() or rte_stats_bitrate_calc() are
passed NULL as the parameter for the stats structure, the
result is a crash. Fixed by adding a sanity check that makes
sure the passed-in pointer is not NULL.

Fixes: 2ad7ba9a6567 ("bitrate: add bitrate statistics library")
Cc: stable@dpdk.org
Signed-off-by: Remy Horton <remy.horton@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
lib/librte_bitratestats/rte_bitrate.c