It is natural that n_attiributes is less than type. But in that case,
the message does not contain any message about the type. So, we should
not abort execution with assertion, but just return -ENODATA.
assert(m->n_containers < RTNL_CONTAINER_DEPTH);
assert(m->containers[m->n_containers].attributes);
- assert(type < m->containers[m->n_containers].n_attributes);
+
+ if (type >= m->containers[m->n_containers].n_attributes)
+ return -ENODATA;
attribute = &m->containers[m->n_containers].attributes[type];