ovs_stats: fix potential NULL dereference
authorMark Kavanagh <mark.b.kavanagh@intel.com>
Mon, 19 Feb 2018 15:23:46 +0000 (15:23 +0000)
committerCiara Loftus <ciara.loftus@intel.com>
Tue, 27 Mar 2018 09:47:05 +0000 (10:47 +0100)
commit968db56ae1744959d83974e78fda321ba5330232
treed7f2db6413a7982ad06db38d2a8c4c69db26136a
parent86f2ca0370eaec2cbd6a5af36534e8bf12954a81
ovs_stats: fix potential NULL dereference

ovs_stats_update_iface() passes a pointer to a potentially-NULL
string to sstrncpy(); this is obviously problematic.

Add a check to ensure that the relevant string is non-NULL.

Fixes: 1cc7599 ("ovs_stats plugin: Fix null dereference of "port".)
Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
src/ovs_stats.c