In ovs_utils_get_map_value(), a potential NULL-string, returned
by YAJL_GET_STRING(), is passed to strcmp, and subsequently
dereferenced. Ensure that said string is non-NULL.
Fixes:
cb59d85 ("ovs_events: Fix plugin collectd config file")
Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
/* return map value if given key equals map key */
str_val = YAJL_GET_STRING(array_values[0]);
- if (strcmp(key, str_val) == 0)
+ if (str_val != NULL && strcmp(key, str_val) == 0)
return array_values[1];
}
return NULL;