In ovs_utils_get_map_value(), YAJL_GET_ARRAY may return NULL,
which is subsequently dereferenced.
Ensure that the returned pointer is non-NULL before attempting
to dereference it.
Fixes:
12f6497 ("ovs_events: Add external ids as metadata")
Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
return NULL;
/* try to find map value by map key */
+ if (YAJL_GET_ARRAY(array_values[1]) == NULL)
+ return NULL;
+
map_len = YAJL_GET_ARRAY(array_values[1])->len;
map_values = YAJL_GET_ARRAY(array_values[1])->values;
for (size_t i = 0; i < map_len; i++) {