utils_ovs: fix potential strcmp() NULL ptr param
authorMark Kavanagh <mark.b.kavanagh@intel.com>
Mon, 19 Feb 2018 15:55:45 +0000 (15:55 +0000)
committerCiara Loftus <ciara.loftus@intel.com>
Tue, 27 Mar 2018 09:47:07 +0000 (10:47 +0100)
commit4b0f10343baca980c684c7d2978b7bea684505b0
tree72302f27780e561fc83092192b8a3a7f15312ead
parent968db56ae1744959d83974e78fda321ba5330232
utils_ovs: fix potential strcmp() NULL ptr param

YAJL_GET_STRING(array_values[0]) may return NULL if
array_values[0]->string is NULL; passing a NULL parameter to
strcmp() is not recommended, since the resultant behaviour may
be undefined.

Resolve the issue by adding a NULL check for the string returned
by YAJL_GET_STRING.

Fixes: cbq59d853 ("ovs_events: Fix plugin collectd config file")
Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
src/utils_ovs.c