diff options
author | Jo-Philipp Wich <jo@mein.io> | 2022-06-08 11:18:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-08 11:18:04 +0200 |
commit | 8282735c2837c03e3666b65309c3162cca5b65a8 (patch) | |
tree | cca199f3b178080759c7509ce16a496d7e9a7b9c | |
parent | bdaad3b3a239c61a1d7008568e3fd7bcde2ddffe (diff) | |
parent | 230e595312b7b0f48ad7129f908d9b337d63e8b6 (diff) |
Merge pull request #83 from jow-/rtnl-fix-linkinfo-segfault
rtnl: fix segmentation fault on parsing linkinfo RTA without data
-rw-r--r-- | lib/rtnl.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1893,8 +1893,9 @@ uc_nl_convert_rta_linkinfo_data(uc_value_t *obj, size_t attr, struct nl_msg *msg } } - if (nattrs > 0) { - attr = (attr == IFLA_INFO_KIND) ? IFLA_INFO_DATA : IFLA_INFO_SLAVE_DATA; + attr = (attr == IFLA_INFO_KIND) ? IFLA_INFO_DATA : IFLA_INFO_SLAVE_DATA; + + if (nattrs > 0 && tb[attr]) { rv = uc_nl_convert_attrs(msg, nla_data(tb[attr]), nla_len(tb[attr]), 0, attrs, nattrs, vm, obj); if (!rv) |