sriov: avoid buffer overrun in rtnl_link_sriov_parse_vflist()

Fixes: 5d6e43ebef

Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Thomas Haller 2017-01-17 18:16:11 +01:00
parent 2d11f40f50
commit 20ed636dee

View File

@ -568,6 +568,8 @@ int rtnl_link_sriov_parse_vflist(struct rtnl_link *link, struct nlattr **tb) {
list_len = 0;
nla_for_each_nested(nla_list, t[IFLA_VF_VLAN_LIST],
list_rem) {
if (list_len >= MAX_VLAN_LIST_LEN)
break;
vf_vlan_info[list_len] = nla_data(nla_list);
list_len++;
}