summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-01-17 17:16:11 (GMT)
committerThomas Haller <thaller@redhat.com>2017-01-17 17:16:11 (GMT)
commit20ed636dee408d5fb288c400394342e619a55559 (patch)
treec45af7deefef9163e05a453ec8d67ed380cf40ac /lib
parent2d11f40f5034eeee4c2c994aa4015aa11d7a3784 (diff)
downloadlibnl-20ed636dee408d5fb288c400394342e619a55559.zip
libnl-20ed636dee408d5fb288c400394342e619a55559.tar.gz
libnl-20ed636dee408d5fb288c400394342e619a55559.tar.bz2
sriov: avoid buffer overrun in rtnl_link_sriov_parse_vflist()
Fixes: 5d6e43ebef12deadf31fccfa46c0b34892675d36 Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/route/link/sriov.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/route/link/sriov.c b/lib/route/link/sriov.c
index 3721ae8..b4bc9a7 100644
--- a/lib/route/link/sriov.c
+++ b/lib/route/link/sriov.c
@@ -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++;
}