In ovs_utils_get_map_value(), YAJL_GET_ARRAY may return a NULL
pointer, which is subsequently dereferenced. Ensure that the
pointer is non-NULL before proceeding.
Fixes:
12f6497 ("ovs_events: Add external ids as metadata")
Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
map_values = YAJL_GET_ARRAY(array_values[1])->values;
for (size_t i = 0; i < map_len; i++) {
/* check YAJL array */
- if (!YAJL_IS_ARRAY(map_values[i]))
+ if (!YAJL_IS_ARRAY(map_values[i]) || YAJL_GET_ARRAY(map_values[i]) == NULL)
break;
/* check a database pair value (2-element, first one represents a key